ASP. NET operating mechanism
Learn more about HttpModule
To create a HttpModule class
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
<summary>
Summary description of models
</summary>
public class Models:ihttpmodule
{
Public models ()
{
//
TODO: Add constructor logic here
//
}
public void Dispose ()
{
throw new NotImplementedException ();
}
public void Init (HttpApplication context)
{
Context. Beginrequest+=context_beginrequest;
Context. Endrequest+=context_endrequest;
}
private void Context_endrequest (object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication; Global variables
App. Response.Write ("}
private void Context_beginrequest (object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication; Global variables
App. Response.Write ("}
}
Then configure the Web. config configuration related actions
Here are two parameters, name and type (type must be the same as the HttpModule you created above)
Note that you need to go through multiple HttpModule
Learn about ASP. NET operating mechanism