Asp Page Lifecycle

Stage

Page Event

Overridable method

Page initialization

Init

 

View state loading

 

LoadViewState

Postback data processing

 

LoadPostData method in any control that implements the IPostBackDataHandler interface

Page loading

Load

 

Postback change notification

 

RaisePostDataChangedEvent method in any control that implements the IPostBackDataHandler interface

Postback event handling

Any postback event defined by controls

RaisePostBackEvent method in any control that implements the IPostBackEventHandler interface

Page pre-rendering phase

PreRender

 

View state saving

 

SaveViewState

Page rendering

 

Render

Page unloading

Unload

 

 

At the property level, the most used is probably "IsPostBack". It returns a Boolean value indicating whether a page has been downloaded in response to itself (a post back).
This property is useful for example, because it allows to initialize the controls only the initial download of the page. ASP.NET manages the state of controls between each request. It is therefore desirable not to lose this state during a second query.
The sample code below shows a page consisting of 2 or Web controls: a label and a button which, when clicked, performs a post back. The language in this false and true initial download when the page is downloaded again in response to itself

Publicités
Cet article a été publié dans DotNet - Asp. Ajoutez ce permalien à vos favoris.

Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s