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.

}
 

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