比如*.asmx我需要给这个类型执行一定东西,但是webconfig里已经有个默认的东西我不想动他,我在
httpHandlers 节点里加两条path="*.asmx"的记录可否解决?还是必须通过新键一个然后new一个出来解决?

解决方案 »

  1.   

    可以指定哪个文件夹下的asmx文件,然后获取
      

  2.   


    问题是我不知道他的httpHandlers会执行些什么,所以也无法判断,到底有没有走他的东西,有点担心
      

  3.   

    asp.net好像是没有这样 的功能,你只能在HttpModule里面处理了,或者new
      

  4.   


    string url = context.Request.Path;
                
                IHttpHandler oHandler = PageParser.GetCompiledPageInstance(url, context.Server.MapPath(url), context);            context.Handler = oHandler;            // 交由Asp.net默认的Handler处理
                oHandler.ProcessRequest(context);