Event & Delegate Question

G

Guest

I have written a control in ASP.Net that needs to react if a specified method
gets fired.

In other words, I want the control to do some work if a method that acts as
the event handler for a button is executed via the button click event.

The developer will be able to assign any method with the same signature as a
button click event handler has to it. This will make the control do some work
whenever any of the button click event handlers execute.

Does anyone have any idea how to handle that? I hope what I'm asking makes
sense.
 
V

V

Hello Demetri,

If your control has a method that needs to be fired whenever the
button_click occurs, all you need to be make sure is that the method
(that has to be fired) should be of the same EventHandler type as that
of a Button_Click.

Then you can simply register your method to the Button.Click event of
any button you want to connect to your control (in addition to the
button'd eventhandler of course).

Regards,
Vaibhav
 

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,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top