Last post Dec 02, 2010 03:45 AM by Qin Dian Tang - MSFT
Nov 29, 2010 05:40 PM|tiwas|LINK
I've been playing around with events lately, and I saw the light when I discovered you could actually subscribe to events in user controls. Way cool! :) So, I redesigned one of them, and discovered that I needed to pass values with the even. So, I redesigned
it again with custom eventargs derived from EventArgs. Now, i used to register my usercontrol on the page with OnRegistered="Registered", and that would trigger my function. However, when I changed my function to protected void Registered(object sender, RegisteredEventArgs
e), I got a compiler error saying there were no matching functions (it was looking for the default EventArgs parameter).
So my question, then, is if it's possible to tell it about the custom event args when registering it on the page, or if I have to cast the EventArg to my custom event...
Hope that's clear, but it's getting late...
Dec 02, 2010 12:55 AM|Qin Dian Tang - MSFT|LINK
Here are some links about handling custom event in user control:
Dec 02, 2010 02:43 AM|tiwas|LINK
Dec 02, 2010 02:44 AM|tiwas|LINK
Actually, these didn't really help...I already know how to handle events with a default signature. What I need to know is how to properly work with events with custom event arguments.
Dec 02, 2010 03:45 AM|Qin Dian Tang - MSFT|LINK
See if these help: