如何注册的HttpHandler在Asp.Net所有子文件夹? [英] How to register HttpHandler for all subfolders in Asp.Net?

查看:120
本文介绍了如何注册的HttpHandler在Asp.Net所有子文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想注册一个HttpHandler,包括根文件夹的所有子文件夹,无论它们是如何远了嵌套。我本来期望用低于code中的行为来做到这一点,但实际上它仅包含在根文件夹直接的项目。

I would like to register an HttpHandler to include all subfolders of a root folder regardless of how far down they are nested. I would have expected the behavior with the below code to do just that but in fact it only includes items directly in the root folder.

<httpHandlers>
  <add verb="*" path="root/*" type="HandlerType, Assembly" />
</httpHandlers>

我当然可以登记为下面包含任何的二线,但还没有遇到一个办法,只是说下面根什么。

I can of course register as below to include anything that is second tier, however have yet to encounter a way to just say anything below root.

<httpHandlers>
  <add verb="*" path="root/*/*" type="HandlerType, Assembly" />
</httpHandlers>

这是值得的帽子已被窃听了我相当长一段时间,我很想听到了一个简单的解决方案。

This is something hat has been bugging me for quite a while and I would love to hear of a simple solution.

我想澄清,当我说根我的意思不是应用程序的根,我不是在发送应用程序中的所有请求的模块进行处理不一定感兴趣。

I would like to clarify that when I say "root" I do not mean the root of the application and am not necessarily interested in sending all requests in the application to a module to be processed.

推荐答案

也许你应该使用HTTP模块,而不是HttpHandler的。

Maybe you should use HttpModule instead of HttpHandler.

这篇关于如何注册的HttpHandler在Asp.Net所有子文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆