H
hb
Hi,
When I add an asp:button (ex: id=btnLog) on home.aspx,
I need to create btnLog_Click() event in home.aspx.cs,
and also link this event and the button in OnInit() method
by adding:
this.btnLog.Click +=new System.EventHandler(this.btnLog_Click);
Now, I need to generate some asp:button dynamically in
an asp:table, and assign the event to all buttons. But in
the event, I need to retrieve the ID of the clicked button.
Would you please tell me:
1. how can I assign the event to a dynamically generated button?
2. how can I add the link between a specific button and the event in
OnInit()
method?
3. how can I retrieve the ID of the clicked button(i.e. the button
that fires the event)?
Thank you
hb
When I add an asp:button (ex: id=btnLog) on home.aspx,
I need to create btnLog_Click() event in home.aspx.cs,
and also link this event and the button in OnInit() method
by adding:
this.btnLog.Click +=new System.EventHandler(this.btnLog_Click);
Now, I need to generate some asp:button dynamically in
an asp:table, and assign the event to all buttons. But in
the event, I need to retrieve the ID of the clicked button.
Would you please tell me:
1. how can I assign the event to a dynamically generated button?
2. how can I add the link between a specific button and the event in
OnInit()
method?
3. how can I retrieve the ID of the clicked button(i.e. the button
that fires the event)?
Thank you
hb