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
 
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.
 
G

Guest

myButton.Click += new EventHandler(myButton_Click);

Where myButton_Click is the method that will handle the event.
 

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top