How can I programmatically set the handler for a random event andhandler

A

acw

I am writing a dynamic asp.net page. To do this I am using an xml file
to hold my data and an xsl file and xslt to create a string that I can
pass into ParceControl.

(see the article by Erick Thompson: http://www.dnzone.com/go?151&LinkFile=page4.htm)

This strategy is working really fine and is very flexible. The only
problem that I have comes when I need to add event handlers for any of
the dynamically created controls.



A simple solution would be to add something like

Button btnX = Page.FindControl("btnX");
btnX.click += new EventHandler(this.myBtnHandler);



What I would like to be able to do is change the xsl to have something
like.

<asp:button id="btn1" wireUp="onclick:myBtnHandler"
wireUpParms="parm1" />

and then look at the output of the my tranform to pull out the wireUp
and wireUpParms attributes and flexibly wire up my handlers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top