473,388 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Event not being raised (how to get list of delegates)

I have an event that is not being raised on postback from client script. It
DOES get raised during a "normal" postback. The event is wired up in the
Page Init. I have traced through and my event target looks correct in both
scenarios.

How can I determine the current list of delegates to see where I am losing
my event when posting back from client script? Or, is there a better way?

Thanks!
Mar 2 '07 #1
2 1433

With C# you have this ability:
private event EventHandler m_myEvent;
public event EventHandler MyEvent
{
add{
m_myEvent += value;
}
remove{
m_myEvent -= value;
}
}


with vb.net, you don't get this. ( why? who knows? microsoft doesn't
allow the add or remove event. ... which is a serious deficiency in my book)

See
http://www.developer.com/net/vb/article.php/2172721
"Karch" <no****@absotutely.comwrote in message
news:Ow**************@TK2MSFTNGP06.phx.gbl...
I have an event that is not being raised on postback from client script.
It
DOES get raised during a "normal" postback. The event is wired up in the
Page Init. I have traced through and my event target looks correct in both
scenarios.

How can I determine the current list of delegates to see where I am losing
my event when posting back from client script? Or, is there a better way?

Thanks!


Mar 2 '07 #2

PS
add
{
m_myEvent += value;
if (m_myEvent == null || m_myEvent .GetInvocationList().Length 0)
{
// there is a interested party
} }
remove
{
m_myEvent -= value;
//stop the listener if no handler is listed
if (m_handler == null || m_handler.GetInvocationList().Length <= 0)
{
// there is still a interested party
}
}
"sloan" <sl***@ipass.netwrote in message
news:uS**************@TK2MSFTNGP05.phx.gbl...
>
With C# you have this ability:
private event EventHandler m_myEvent;
public event EventHandler MyEvent
{
add{
m_myEvent += value;
}
remove{
m_myEvent -= value;
}
}


with vb.net, you don't get this. ( why? who knows? microsoft doesn't
allow the add or remove event. ... which is a serious deficiency in my
book)
>
See
http://www.developer.com/net/vb/article.php/2172721
"Karch" <no****@absotutely.comwrote in message
news:Ow**************@TK2MSFTNGP06.phx.gbl...
I have an event that is not being raised on postback from client script.
It
DOES get raised during a "normal" postback. The event is wired up in the
Page Init. I have traced through and my event target looks correct in
both
scenarios.

How can I determine the current list of delegates to see where I am
losing
my event when posting back from client script? Or, is there a better
way?

Thanks!


Mar 2 '07 #3

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

Similar topics

5
by: Ian Richardson | last post by:
I'm writing some code which does one thing when onreadystatechange occurs, e.g. handle.onreadystatechange = function() { blah(handle,other_params) }; ....but sometimes I need to add another,...
13
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...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
5
by: Mike | last post by:
Hi group; Let say I have an object called Account, that raises an event called AccountLow with its owns EventArgs, and when this event gets raised, I will like to raise another custom...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...

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.