排除某些网页使用一个HTTP模块(Exclude certain pages from using a HTTPModule)

   IT问题网   2018-12-22 00:00:00

问 题

有没有排除使用一个http模块某些网页的好办法?

我有一个使用自定义的http模块来验证会话的应用程序。该http模块设置这样的web配置:

 的system.web
- !...- 
的httpmodules
添加名称="sessionvalidationmodule"
type ="sessionvalidationmodule,somenamespace"/
 / httpmodules的
 /system.webgt;
 

要排除的页面模块,我试图做这个(没有成功):

 位置路径="tobeexcluded"
的system.web
- !...- 
的httpmodules
删除名称="sessionvalidationmodule"/
 / httpmodules的
 /system.webgt;
 /地点
 

有什么想法?

解决方案

您可以使用一个httphandler,而不是一个http模块。处理程序允许您指定的路径,当你在web.config中声明它们。

 加上动词="*"路径="/验证/ * aspx。"type ="处理程序,集结号"/
 

如果必须使用http模块,你可以只检查请求的路径,如果它是一个被排除在外,绕过验证。

标签:排除某些网页使用一个模块



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

Project.json定义dnx451 VS .dotnet(4.51)(Project.json definition dnx451 vs .dotnet ( 4.51))

problem i've some in asp vnext i can define 3 types of r ...

我如何得到一个程序集的版本,而无需加载呢?(How do I get the version of an assembly without loading it)

problem one small function of a large program examines as ...

如何将数据追加到一个二进制文件?(How append data to a binary file)

problem i have a binary file to which i want ...

如何调试"无法加载文件或程序集"运行时错误?(How to debug "Could not load file or assembly" runtime errors)

problem i have a project that uses a java library convert ...

谁在字典。第一()?(Who's on Dictionary<>.First())

problem what is the meaning of the .net 3.5 extension met ...

我该如何使用IEnumerator.Reset()?(How Can I Use IEnumerator.Reset())

problem how exactly is the right way to call ienumerator. ...

你如何重置一个C#.NET的TextReader光标回到起点?(How do you reset a C# .NET TextReader cursor back to the start point)

problem i have a method that takes either a stringreader ...

什么是名单,其中最后的()扩展方法的性能; T?(What is the performance of the Last() extension method for List<T>)

problem i really like last() and would use it all the tim ...

为什么空需要在这里投下了明确的类型?(Why does null need an explicit type cast here)

problem the following code does not compile: //int a = . ...

为什么有这么多的$如果定义(CLR)中的VCL / RTL?(Why are there so many $IF DEFINED(CLR) in the VCL/RTL)

problem i've just compared the delphi 2009 vcl/rtl code t ...

数据视图和数据表之间的区别是什么?(What is the difference between dataview and datatable)

problem what is the difference between dataview and datat ...

正是依靠和放大器;&安培;短路安全的.NET?(Is relying on && short-circuiting safe in .NET)

problem assume myobj is null.is it safe to write this if ...

为什么C#小数离不开m后缀进行初始化?(Why c# decimals can't be initialized without the M suffix)

problem public class myclass { public const decimal const ...

"类型预计不会与QUOT;,使用的DataContractSerializer - 但它只是一个简单的类,没有有趣的东西?("Type not expected", using DataContractSerializer - but it's just a simple class, no funny stuff)

problem i'm refactoring my xml-serialization, and figured ...

我可以在.NET Framework 4.0中运行MVC 5应用程序?(Can I run MVC 5 application on .NET Framework 4.0)

problem i have my mvc 5 application that i create in vs 2 ...

Func键和行动Java的等价物(Java's equivalents of Func and Action)

problem what are java's equivalents of func and action i ...

如何才能对象不能比拟为空?(How can an object not be compared to null)

problem i have an 'optional' parameter on a method that i ...

加载非常大的CSV文件为s的SQL Server数据库(Load very big CSV-Files into s SQL-Server database)

problem is there a performant way to load very big csv-fi ...

优化版本库的的SubmitChanges方法(Optimizing Repository’s SubmitChanges Method)

problem i have following repository. i have a mapping bet ...

文本框自动完成在一个DataGridView Winform的(Textbox Autocomplete in a DataGridView Winform)

problem i've got my datagridview binding correctly to my ...