tags:

views:

39

answers:

2

I want to know in which event or process asp.net page set/update the value of IsPostBack. How page figure out it value?

+3  A: 

There is two overridable methods LoadPostData and RaisePostDataChangedEvent method in all the controls that implements the IPostBackDataHandler interface. The same are checked by ASP.Net while the Page loads.

Once the HTTP page handler class is fully identified, the ASP.NET run time calls the handler's ProcessRequest method to process the request.

Next, ProcessRequest makes the page transit various phases: initialization, loading of view state information and postback data, loading of the page's user code and execution of postback server-side events

In simple terms, When the user clicks a button, the page posts back. The collection of posted values contains the ID of the button that started the whole operation. If the control is known to implement the IPostBackEventHandler interface (buttons and link buttons will do), the page framework calls the RaisePostBackEvent method.

There is an excellent and detailed article about ASP.Net Page cycle here

You can find more details there.

Happy Programming,

Vimal Raj
Thanks for your answer, i went through it, its quite informative.
Jeevan Bhatt
IsPostBack is a read only property so asp.net where change its value. how ProcessRequest(HttpContext context) method do it.
Jeevan Bhatt
+1  A: 

The IsPostBack is set by ASP.NET framework. Handling of IsPostBack value is transparent to the developer. The IsPostBack varaible is set in PreInit event only. To get more information about this you need to check ASP.NET page lifecycle.It is avaible on msdn here.

Manoj