Hooking Post Back Event

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
 
Y

Yovi Oktofianus

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
 
J

John Saunders

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.
 
J

Jalil Vaidya

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top