ASP. NET HttpApplication request pipeline and session (i)

Source: Internet
Author: User

1. Request Processing Sequence Execution events

        /******************** Request processing Sequence execution Event **********************/        /// <summary>        ///Request Inbound///disable access to the session in this pipeline/// </summary>        protected voidApplication_BeginRequest () {Response.Write ("----beginrequest---"); Response.Write ("<br/>"); }        /// <summary>        ///before sending content to the client///access to session is forbidden in this pipeline/// </summary>        protected voidapplication_presendrequestcontent () {Response.Write ("----presendcontent---:"); Response.Write ("<br/>"); }        /// <summary>        ///page framework Execution///the session can be accessed in this pipeline/// </summary>        protected voidApplication_postrequesthandlerexecute () {Response.Write ("----PostRequestHandlerExecute---count:"+ Session.count +", current SessionID:"+Session.SessionID); StringBuilder Builder=NewStringBuilder (); Response.Write ("<div style= ' text-indent:2em; ' >"); foreach(stringIteminchSession.keys) {stringline =string. Format ("---{0}:{1}", item, Session[item]); Builder.            Appendline (line); } Response.Write (Builder.            ToString ()); Response.Write ("</div>"); Response.Write ("<br/>"); }        /// <summary>        ///page Frame release request status///access to session is forbidden in this pipeline/// </summary>        protected voidApplication_releaserequeststate () {Response.Write ("----Releaserequeststatet---"); Response.Write ("<br/>"); }        /// <summary>        ///page Frame response completed///This pipeline, prohibit the use of Session/// </summary>        protected voidApplication_updaterequestcache () {Response.Write ("----Updaterequestcache---"); Response.Write ("<br/>"); }        /// <summary>        ///requesting outbound///access to session is forbidden in this pipeline/// </summary>        protected voidApplication_EndRequest () {Response.Write ("----EndRequest---"); Response.Write ("<br/>"); }

Access before session data is added:

After adding session data, visit:

ASP. NET HttpApplication request pipeline and session (i)

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.