D
Dave R
Anyone know how to wire up an event handler for controls added to an ASP.NET
page at run-time? Of course, at design-time this is easy: just enter the
method's name in the event tab of the control's properties. But what if I
do...
LinkButton lb = new LinkButton();
lb.Text = "Click me now!";
cell.Controls.Add(lb);
I want to create a handler for lb's Click event, like...
lb.Click = "MyHandler";
....but that syntax is illegal. When you click the button, it properly posts
back, but I can't infer in Page_Load() the reason (i.e., the originator) of
the action. Can't find anything in the on-line docs about this. Any ideas?
Thanks,
:-David
page at run-time? Of course, at design-time this is easy: just enter the
method's name in the event tab of the control's properties. But what if I
do...
LinkButton lb = new LinkButton();
lb.Text = "Click me now!";
cell.Controls.Add(lb);
I want to create a handler for lb's Click event, like...
lb.Click = "MyHandler";
....but that syntax is illegal. When you click the button, it properly posts
back, but I can't infer in Page_Load() the reason (i.e., the originator) of
the action. Can't find anything in the on-line docs about this. Any ideas?
Thanks,
:-David