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)