G
Guest
How do I tell wether I'm seeing autopostback vs submit button click in
Page_load?
Thanks for any clues.
Page_load?
Thanks for any clues.
Dabbler said:Thanks for the page cycle link. I'm still puzzled though, when a user
presses the submit button I need to process the form data. I was going to
call a function from the Page Load with ispostback = true. But if a control
has autopostback enabled (a drop down list for instance) how do I know if I
can process the data or it's just a dropdownlist refreshing.
Thanks much.
Michael
Phillip Williams said:Take a brief look at the description of the various stages of the page cycle:
http://msdn.microsoft.com/library/d...guide/html/cpconcontrolexecutionlifecycle.asp
You would typically use the Load event to perform actions common to all
requests. Then during handling the postback events you would realize which
control made a request. Then you can use the PreRender to do what you
probably were trying to do in the Load event. In other words, in the
standard programming style in ASP.NET you do not need to decide which control
caused the postback during the page load event.
Having said so, you can still check the value of
Request.Form["__EVENTTARGET"] to find the ID of the control that caused the
AutPostBack.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
Dabbler said:How do I tell wether I'm seeing autopostback vs submit button click in
Page_load?
Thanks for any clues.
Phillip Williams said:Take a brief look at the description of the various stages of the page cycle:
http://msdn.microsoft.com/library/d...guide/html/cpconcontrolexecutionlifecycle.asp
You would typically use the Load event to perform actions common to all
requests. Then during handling the postback events you would realize which
control made a request. Then you can use the PreRender to do what you
probably were trying to do in the Load event. In other words, in the
standard programming style in ASP.NET you do not need to decide which control
caused the postback during the page load event.
Having said so, you can still check the value of
Request.Form["__EVENTTARGET"] to find the ID of the control that caused the
AutPostBack.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
Dabbler said:How do I tell wether I'm seeing autopostback vs submit button click in
Page_load?
Thanks for any clues.