Versions des environnements
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement