i have a solution with a web application that i want to creat a new http module for and cant find a way in 开发者_JAVA百科the VS2010 IDE to add a httpmodule.
im trying to right click and add new item but don't find httpmodule listed.
And HTTP Module is a class implementing IHttpModule. Just reference System.Web.dll and use System.Web namespace, implement the interface and this is everything you need!
Well, you'll need to add an entry in "modules" in your Web.config:
Do so by adding a child "httpModules" elements in system.web node:
<httpModules>
<add name="Blah" type="Assembly qualified name of HTTP Module class [namespace.type, assembly]"/>
</httpModules>
And in system.webServer child "modules" element:
<modules>
<add name="Blah" type="Assembly qualified name of HTTP Module class [namespace.type, assembly]"/>
</modules>
精彩评论