2.0 : write handlers

  • Thread starter Thread starter John A Grandy
  • Start date Start date
J

John A Grandy

ASP.NET 2.0 : C# : How do you code the handlers for control events ? I
read that explicitly adding delegates pointing to a handler method is no
longer necessary.

So what is the new way ?
 
If you have a <asp:Button id="button1" runat="server" /> then in your
code behind class you can handle the buttons click event by using:

ControlName_EventName(object sender, EventArgs e)

i.e.

button1_Click(object sender, EventArgs e)
{
//do someting
}
 
Select the control and the event in drop down list in IDE code editor window.
Good Luck
DWS
 

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

Back
Top