Learn about ASP. NET operating mechanism

Source: Internet
Author: User

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

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.