473,503 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Event & Delegate Question

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.

--
-Demetri
Jun 16 '06 #1
1 1107
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

Demetri wrote:
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.

--
-Demetri


Jun 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2528
by: emma middlebrook | last post by:
Hi I want to find out what objects are due to receive an event i.e. those that have added themselves as an event handler via +=. Yes, it's a little pointless perhaps (or can anyone give some...
7
1781
by: Brian Keating | last post by:
hi there this may seem like a silly question but what exactly is the difference ... ok .. that question is probably a bit ambiguous.. i know what delegates are i know what events are, i use them...
5
3001
by: Mike Labosh | last post by:
In VB 6, the Form_QueryUnload event had an UnloadMode parameter that let me find out *why* a form is unloading, and then conditionally cancel the event. In VB.NET, the Closing event passes a...
20
2357
by: Bob Day | last post by:
Using VS 2003, VB, MSDE... There are two threads, A & B, that continously run and are started by Sub Main. They instantiationsl of identical code. Thread A handles call activity on telephone...
13
3478
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the...
4
2107
by: Peter Oliphant | last post by:
I've upgraded my code to VS C++.NET 2005 (Express) using /clr pure. My question is, why is there an exception to the rule in how pointer syntax is done in the event handlers? For example, why is...
1
1607
by: Scott M. | last post by:
I'm trying to get my head around what's involved in C# to declare, raise and respond to an event. I'm coming from the VB.NET world where to declare and event we wrote: Public Event Foo() To...
3
1048
by: Curious | last post by:
Hi, I have a program that gets the prices of stocks in real-time. The program consists of the following key components: // Constructor public GetRealTimeStockPrice() { // Step 1
24
55029
by: =?Utf-8?B?U3dhcHB5?= | last post by:
Can anyone suggest me to pass more parameters other than two parameter for events like the following? Event: Onbutton_click(object sender, EventArgs e)" Event handler: button.Click += new...
4
237
by: tshad | last post by:
I am just getting started with events and had a couple of questions on why they do what they do. If you have a textbox and you want to handle an event you can just do: ...
0
7072
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7271
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
373
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.