Register the HTTP module in the configuration file
After the HTTP module is created and copied to the bin directory of the Web application or Global Assembly Cache. config or machine. config.
We can use the
Because configuration settings can be inherited, subdirectories inherit configuration settings from the parent directory. As a result, subdirectories may inherit some unwanted HTTP modules (which are part of the parent configuration information). Therefore, we need a method to delete these unnecessary modules. You can use the <remove> node. If you want to delete all HTTP modules inherited from the application, you can use the <clear> node.
The following code is a common example of adding an HTTP module:
<Httpmodules>
<Add type = "classname, assemblyname" name = "modulename"/>
<Httpmodules>
The following code deletes an HTTP module from an application:
<Httpmodules>
<Remove name = "modulename"/>
<Httpmodules>
In the preceding XML:
· The type attribute specifies the actual type of the HTTP module in the form of class and part names.
· The name attribute specifies the friendly name of the module. Other applications can use this name to identify the HTTP module.
How to Use the HTTP module during ASP. NET running
The HTTP module is used to implement some special functions when ASP. NET is running. The following snippet is from the machine. config file. It displays the HTTP module installed during ASP. NET runtime:
<Httpmodules>
<Add name = "outputcache" type = "system. Web. caching. outputcachemodule"/>
<Add name = "session" type = "system. Web. sessionstate. sessionstatemodule"/>
<Add name = "windowsauthentication"
Type = "system. Web. Security. windowsauthenticationmodule"/>
<Add name = "formsauthentication"
Type = "system. Web. Security. formsauthenticationmodule"/>
<Add name = "passportauthentication"
Type = "system. Web. Security. passportauthenticationmodule"/>
<Add name = "urlauthorization"
Type = "system. Web. Security. urlauthorizationmodule"/>
<Add name = "fileauthorization"
Type = "system. Web. Security. fileauthorizationmodule"/>
</Httpmodules>
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