Hooking Post Back Event

  • Thread starter Thread starter Yovi Oktofianus
  • Start date Start date
Y

Yovi Oktofianus

Hi all,

is it posible to hook every post back event ?

My goal is I want to know which control send post back event to my page
before Page.OnLoad event raised. Or at least in Page_Load event handler i
can find out which control raise it.

Thank's
 
Yup, but, I cannot find out which control send post back event, with the
method you suggest me I can only find out is page load event a Post Back
Event or not.

How can we know the control who send it (postback event) ?

Thank's & Regards

Yovi
 
Yovi Oktofianus said:
Yup, but, I cannot find out which control send post back event, with the
method you suggest me I can only find out is page load event a Post Back
Event or not.

How can we know the control who send it (postback event) ?

It's usually a bad idea to try to figure out which control caused the
PostBack.

Usually, people just handle the various Click or SelectedIndexChanged
events.
 
Request.Form["__EVENTTARGET"] will give the UniqueID of the control that
caused the postback to fire. As this is an implementation detail of
ASP.NET and is subject to change in future, it is usually a bad idea to
play around with it. I would also like to point out that the UniqueID of
a control can be different than the ID that you gave to the control.

HTH,

Jalil Vaidya
 
Back
Top