I ran across this question quite some time ago. I got a question from some
developer that wanted to know in the page_load which control is fiiring the
event, because events are processed later... But. In normal situations if
you have to do something like this, your design approach is wrong. Every
page Get/Post execution can and MUST if possible be written the "normal" way
that means fiiring control related events and without any processing in the
Initialize phase.
Probably you're making a problem with it.
But beside that if you really want to get your hands dirty with this, get
the controls name in:
Request["__EVENTTARGET"];
but you'll have to change ":" into "_". But that still wouldn't get you
right in because this way, you'll get ClientID, not the actual ID, but
you'll be nearer to your goal. Actually you'd be doing your own
ProcessPostBackData() which normally gets called and parses the originator
of the postback and preparing the data for fiiring control events at every
single postback.
--
RobertK
{ Clever? No just smart. }
Philip Ashworth said:
Hi,
Does anybody know how to detect the source of a postback. I've debuged the
sender on the page load event and although I see a long list I can't see
what control actually fired the postback.
Regards
Philip Ashworth