Processing Page Requests
When an initial request for a page (a Web Form) is received by ASP.NET, it locates and loads the requested Web Form (and if necessary compiles the code). It is important to understand the sequence of events that occurs when a Web Forms page is processed. This knowledge will help you program your Web Forms pages and Web applications more effectively.
As described before, initial page requests are relatively simple. The real work gets done when a page is submitted to itself - and a postback request is generated. Here are a few notes on postback requests:
- The current value of every control on a Web Form is contained in the postback request. This is referred to as the Post Data
- The content of the ViewState is also contained in the Post Data. ViewState holds theoriginal property values of every control on a Web Form - before the user made any changes
- If a postback was caused, for example, by a button click, Post Data is used to identify the button that caused the postback
Postback Event Processing Sequence
Here are the events (and the order) that are raised when a Button is clicked and a postback occurs:- Page.Init + Control.Init for every control on the Web Form
The first stage in the page life cycle is initialization. After the page's control tree is populated with all the statically declared controls in the .aspx source the Init event is fired. First, the Init event for the Page object occurs, then Init event occurs for each control on the Page. Viewstate information is not available at this stage. - Page.LoadViewState
After initialization, ASP.NET loads the view state for the page. ViewState contains the state of the controls the last time the page was processed on the server. - Page.ProcessPostData
Post Data gets read from the request and control values are applied to control initalized in stage 1. - Page.Load + Control.Load for each control on the Page
If this is the first time the page is being processed (Page.IsPostback property), initial data binding is performed here. - "Change" events are fired for controls (TextChanged, SelectedIndexChanged, and similar)
The current value (from Post Data) is compared to the original value located in the ViewState. If there is a difference "Changed" events are raised. - Server-side events are fired for any validation controls
- Button.Click + Button.Command
The Click and Command events are fired for the button that caused the postback - Page.PreRender + Control.PreRender
- Page.SaveViewState
New values for all the controls are saved to the view state for another round-trip to the server. - Page.Render
A more detailed explanation of the postback processing can be found in the "The ASP.NET Page Object Model - One Day in the Life of an ASP.NET Web Page" article.
"Learn about the eventing model built around ASP.NET Web pages and the various stages that a Web page experiences on its way to HTML. The ASP.NET HTTP run time governs the pipeline of objects that transform the requested URL into a living instance of a page class first, and into plain HTML text next. Discover the events that characterize the lifecycle of a page and how control and page authors can intervene to alter the standard behavior"
"Learn about the eventing model built around ASP.NET Web pages and the various stages that a Web page experiences on its way to HTML. The ASP.NET HTTP run time governs the pipeline of objects that transform the requested URL into a living instance of a page class first, and into plain HTML text next. Discover the events that characterize the lifecycle of a page and how control and page authors can intervene to alter the standard behavior"
ViewState - the all mighty!
As you can see from the postback steps, the ViewState has a major role in ASP.NET. Viewstate is a collection of name/value pairs, where control's and page itself store information that is persistent among web requests.
"Understanding ASP.NET View State" looks at how an ASP.NET page maintains its state changes across postbacks, examining:
- The ASP.NET Page Life Cycle
- The Role of View State
- The Cost of View State
- How View State is Serialized/Deserialized
- Specifying Where to Store the View State Information (see how to store it in a file on the Web server rather than as a bloated hidden form field)
- Programmatically Parsing the View State
- View State and Security Implications
Note: if you need to examine the ViewState while debugging, try the Page ViewState Parsers
chi flat iron, north face jackets, vans shoes, uggs outlet, marc jacobs, north face outlet, herve leger, reebok outlet, soccer jerseys, nike huarache, ugg pas cher, insanity workout, ghd, hollister, wedding dresses, soccer shoes, mcm handbags, canada goose outlet, ugg boots, mac cosmetics, abercrombie and fitch, ferragamo shoes, canada goose, babyliss pro, beats by dre, longchamp, celine handbags, p90x, ugg, rolex watches, instyler, ugg australia, birkin bag, canada goose jackets, ugg boots, giuseppe zanotti, uggs outlet, ugg boots, nike roshe run, valentino shoes, nfl jerseys, asics running shoes, bottega veneta, lululemon outlet, mont blanc, jimmy choo outlet, new balance shoes
ReplyDeleteherve leger, timberland boots, giuseppe zanotti, iphone cases, insanity workout, mac cosmetics, reebok shoes, hollister, bottega veneta, vans shoes, soccer shoes, gucci, mont blanc, new balance, soccer jerseys, nike roshe, babyliss, converse, valentino shoes, ray ban, jimmy choo shoes, birkin bag, north face outlet, nike air max, baseball bats, nike air max, hollister, louboutin, nike trainers, instyler, ralph lauren, chi flat iron, hollister, ferragamo shoes, vans, nfl jerseys, converse outlet, mcm handbags, nike huarache, celine handbags, p90x workout, wedding dresses, abercrombie and fitch, north face outlet, longchamp, lululemon, ghd, oakley, asics running shoes, beats by dre
ReplyDeletecanada goose uk, louis vuitton, swarovski, thomas sabo, canada goose outlet, doudoune canada goose, supra shoes, links of london, karen millen, moncler, sac louis vuitton pas cher, pandora jewelry, ugg,ugg australia,ugg italia, hollister, wedding dresses, juicy couture outlet, canada goose, moncler, barbour jackets, marc jacobs, pandora charms, toms shoes, pandora charms, bottes ugg, coach outlet, montre pas cher, canada goose outlet, louis vuitton, moncler, louis vuitton, ugg pas cher, ugg boots uk, barbour, lancel, pandora jewelry, moncler, louis vuitton, moncler, swarovski crystal, juicy couture outlet, canada goose, moncler outlet, canada goose, moncler, replica watches, ugg,uggs,uggs canada, canada goose, moncler
ReplyDeleteشركة مكافحة حشرات
ReplyDeleteمكافحة حشرات
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
4U8P0O
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
CF4İE