rebinding event handlers, how?


L

lauralucas

Hi
I'm creating controls programatically. On postback, the events of the
controls are not triggered correctly. I need to not only rebind the
controls to their datasource on every load, but reassign the event
handlers.

but how?

I should do this in the Page's Init event handler rather than in the
Page_Load
event handler right?

help me please, I'm stuck
 
Ad

Advertisements

G

Guest

Init would be a far better choice than Load since a lot can happen between
Init and Load. If you assign your event handlers in the init event it should
fire properly. If that is not working could you provide us with more detail?
 
L

lauralucas

I don't know how to assign event handlers programatically to an object
yet, how do yo do it?
more especifically, a buttoncolumn in a datagrid.
 
Ad

Advertisements

G

Guest

myButton.Click += new EventHandler(myButton_Click);

Where myButton_Click is the method that will handle the event.
 

Top