Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selectively firing events
Message
De
23/08/2006 16:08:34
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01147981
Message ID:
01148010
Vues:
14
>Hopefully I can explain this...
>
>I've got a user control that has a dropdown list on it. It calls an object which retrieves some data that I then use to populate the dropdown with.
>
>I can see a need to be able to raise an event when the user changes the combo (e.g. the default SelectedIndexChanged event of the dropdown). I don't want a postback to happen if no one is listening for this event (that is, in my user control if I were to just bind to SelectedIndexChanged and raise my own event, a postback will occur each time an item is changed even if the page it was hosted on didn't care about the event). I am trying to avoid this postback if it's not necessary.
>
>I thought about just adding a boolean property that basically says, "Raise this event" but that feels kind of like a hack. However, I don't really see any other way of doing this automatically.
>
>Any ideas?

Paul,

I see in the help that web controls have an Events property (inherited from Control) that will return an EventHandlerList. I don't see anything in the EventHandlerList that would tell you the number of events, but perhaps it is a place to start looking.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform