Tuesday, August 5, 2008

The Statelessness of Web Page

In ASP.NET, it is common to have some data members of our Page class (one who derived from System.Web.UI.Page). It is important to keep in mind that those members are re-defined or re-declared every time a new instance of our Page class is created. This happens each time there is a round-trip between the server and the browser (i.e. but may not limited to: Page_Load event). Therefore, we need to be aware of the state of those data members.

One more thing: even if an UpdatePanel is used in a page, Page_Load event still gets fired every time.

No comments: