Note that there are some explanatory texts on larger screens.

plurals
  1. POIn ASP.NET MVC, the ProcessRequest in my own MyHttpHanler just cannot be fired
    primarykey
    data
    text
    <p>I am trying to add some Routing rule in Global.ascx im my ASP.NET MVC application. I extend the <code>IRouteHanlder</code>, <code>MVCHandler</code> and <code>registe</code> the rule just as follow.</p> <pre><code> public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); //routes.MapRoute( // "DefaultTT", // Route name // "test", // URL with parameters // new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults //); RouteValueDictionary defaults = new RouteValueDictionary(); RouteValueDictionary constraints = new RouteValueDictionary(); RouteValueDictionary tokens = new RouteValueDictionary(); defaults.Add("controller", "home"); defaults.Add("action", "index"); defaults.Add("data", string.Empty); constraints.Add("data", @"[a-zA-Z0-9\-]*"); tokens.Add("pageId", 0); routes.Add(new Route("", defaults, constraints, tokens, new MyRouteHandler())); } public class MyRouteHandler : IRouteHandler { public System.Web.IHttpHandler GetHttpHandler(System.Web.Routing.RequestContext requestContext) { return new MyMVCHanlder(requestContext); } } public class MyMVCHanlder : MvcHandler { public MyMVCHanlder(RequestContext requestContext) : base(requestContext) { } protected override void ProcessRequest(HttpContext httpContext) { int i = 1; int j = i + 1; base.ProcessRequest(httpContext); } protected override void ProcessRequest(HttpContextBase httpContext) { int i = 1; int j = i + 1; base.ProcessRequest(httpContext); } } </code></pre> <p>But when I visit localhost:50112/ in my browser, the ProcessRequest method cannot be fired. I don't know why. Do you have any thought? Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload