HttpHandler 101 FAIL

后端 未结 3 1652
醉话见心
醉话见心 2021-01-03 05:24

When I add an HTTP handler:


With the class:

using System;
usin         


        
相关标签:
3条回答
  • 2021-01-03 05:35

    When the Handler is a class in my App_Code directory the following works for me:

        <add verb="*" path="*test.aspx" type="Test.Handler,__Code"/>
    

    (I've only added handlers for whole prefixes like "*.test").

    0 讨论(0)
  • 2021-01-03 05:36

    By default asp.net Pagerhandlerfactory object will handle all the .aspx resource request.

    0 讨论(0)
  • 2021-01-03 05:51

    I guess you are using a web site project in contrast of web application project. In this case you need to put the code behind file of your handler (Handler.cs) in the special App_Code folder. The markup file (Handler.ashx) may be at the root of your site:

    <%@ WebHandler Language="C#" Class="Handler" CodeBehind="Handler.cs" %>
    

    Then you can directly declare your handler in web.config:

    <add verb="*" path="*test.aspx" type="Handler"/>
    
    0 讨论(0)
提交回复
热议问题