How to create dynamic events handlers for Imagebuttons

R

RA

Hi

I have a dynamic asp.net table created from the database. I am adding an
ImageButton to each row so the client can click on it. Each ImageButton has
the ID = orderid from database. How can I receive the click event when the
user clicks one of the buttons. Eventually I would like to do the same
processing for all buttons depending on their ID.


Thanks,
Ronen
 
A

alex bowers

Hi Ronen,
If you create the buttons dynamically in the
Page_Initialize event then your page will be able to
receive click events from them. Creating them in the
Page_Load event (as most people try to do by default)
results in the events not being wired up.

alex
 

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

No members online now.

Forum statistics

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

Latest Threads

Top