Button little question

  • Thread starter Thread starter Josema
  • Start date Start date
J

Josema

Hi to all...

I have a class that inherit from WebControl

this class create a button with Button mybtn=new Button...

How i can write something in the event Onclick of this
button? its possible?

Thanks in advance.
Best Regards.
Josema.
 
you need to attach an event handler to the buttons click event in the class
that is creating it such as this:

YourButton.Click += new EventHandler(BTN_Click);

then create a method like this

private void BTN_Click(object sender, System.EventArgs e)

{

//your code will execute here when the button is clicked.

}
 
Back
Top