使用 asp.net MVC 3,我在 Global.asax
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
我希望路线来自 CustomRouteHandler。
public class CustomRouteHandler : IRouteHandler
{
public IHttpHandler GetHttpHandler(RequestContext requestContext)
{
CustomHttpHandler handler = new CustomHttpHandler(requestContext);
return handler;
}
}
如何更改我的 routes.MapRoute 代码?