在ASP.NET MVC中支持 HttpHandler
时间:2014-01-15 20:15:52
收藏:0
阅读:500
写HttpHandler与ASP.NET WebForm基本没有什么不同。只是部署的时候需要注意,只在Web.config中注册还不行,需要在Global.asax.cs添加一条ignore规则:
protected void
Application_Start()
{
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteTable.Routes.IgnoreRoute("{filename}.ashx");
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
链接:
http://www.hanselman.com/blog/BackToBasicsDynamicImageGenerationASPNETControllersRoutingIHttpHandlersAndRunAllManagedModulesForAllRequests.aspx
原文:http://www.cnblogs.com/qkhh/p/3515348.html
评论(0)