有没有办法IHttpHandler从当前HttpContext或web.config 获取已注册的s 的类型?
我试图看看我HttpHandler是否在web.config中注册了WebControl.
您可以通过HttpHandler以下方式从web.config 获取已注册的列表:
using System.Configuration;
using System.Web.Configuration;
Configuration cfg = WebConfigurationManager.OpenWebConfiguration("/");
HttpHandlersSection hdlrs = (HttpHandlersSection)cfg.GetSection("system.web/httpHandlers");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1192 次 |
| 最近记录: |