Basic knowledge of asp.net architecture-pages and global events

Source: Internet
Author: User

1.asp.net request process and corresponding dll for processing requests
The customer's request page is processed by the dynamic Connection Library aspnet_isapi.dll, which sends the requested aspx file to CLR for compilation and execution, and then returns the Html stream to the browser.

2. Page events (arranged by event execution order)

Page_Init: initialization value or connection
Page_Load: mainly uses IsPostBack. This event mainly performs a series of operations to create an asp.net page or response for the first time.
Client events caused by shipping. The page and control view status have been restored before this event.
Page_DataBind: it can be called at the page level or in a single control.
DataBind_PreRender: Pre-rendering of data binding, which is triggered just before the view status and Rendering Control are saved.
Page_Unload: This event executes the final cleaning.
Uncertain event
Page_Error: if an unhandled exception occurs during page processing, an error event is triggered.
Page_AbortTransaction: Transaction event. If a transaction has been terminated during transaction processing, this event is triggered and is commonly used in shopping carts.
Page_CommitTransaction: this event is triggered if the transaction is successful.

You can define @ Page Transaction = Required on the Page to define the time attribute of the Page. However, this method does not necessarily feel good when you start a transaction on the page.

Events in Global. asax (execution sequence)
Application_Start: triggered when the application starts
Application_BeginRquest: triggered when an http request starts.
Application_AuthenticateRequest: triggered when the application approves an http request
Session_Start: triggered when the session is started
Application_EndRequest: triggered when the Htttp request ends
Session_End: triggered when the session ends
Application_End: triggered when the application ends
Application_Error: triggered when an error occurs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.