我希望有一个简单的解决方案。我正在使用MVC 3.我的解决方案中有两个项目,名为MyApp.Domain的类库和名为MyApp.WebUI的MVC 3 Web应用程序。创建我的第一个HttpHandler - 不起作用
在MyApp.Domain,我有这个文件:
namespace MyApp.Domain.Test
{
public class MyHandler : IHttpHandler
{
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
context.Response.Write("test");
}
}
}
在MyApp.WebUI,在项目的根目录中的web.config,我有这样的:
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="*.testhandler" type="MyApp.Domain.Test.MyHandler"/>
</httpHandlers>
</system.web>
</configuration>
但如果我导航到http://localhost:52233/test.testhandler,我得到一个404错误。我想有一些名称空间问题,但我不知道如何解决它。
任何人都遇到过这个问题?
好的,赶上,谢谢。 – Steven
帮助我呢!谢谢! –