I have a control that I only want to emit postback submission if its events have handlers attached to them. For my example let's assume that the event is called ServerClick. Here's where it gets interesting.
In the control, upon the initial loading of the page, I can inspect the event via the hidden member ServerClickEvent ala either of the following:
CType(ServerClickEvent, System.MulticastDelegate).GetInvocationList()
or
Dim handler As EventHandler = CType(Events(ServerClickEvent), EventHandler)
Once I postback though and the OnServerClick event has been handled, ServerClickEvent is nothing. Why is this?
If I emit postback code regardless of attached handlers, the OnServerClick event is always handled correctly by the page (despite the above description), so I know there's something, somewhere that I can get the information I want... How can I tell 100% of the time whether any specified event has an invocation list with a length greater than 0?
Underpaid, painfully underutilized, and always looking for more work in Va.