SaaS CMS has officially launched! Learn more now.

MVC Route from Gadget


I have this url in my system http://localhost:17007/modules/EpiCase/Config/Index and I wanna change to http://localhost:17007/EpiCase/Config/Index .

I tried add a route on the resgister routes, look like this.

  name: "EPiCase_Default",
  url: "EPiCase/{controller}/{action}/{id}", 
  defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }


And I call RegisterRoutes on InitializationModule but when I try go to http://localhost:17007/EpiCase/Config/Index I get 404 erro.


Feb 27, 2014 3:51

It could be either that "wrong" route handles the request, no route handles the request or that the controller cant be found. To determine which case it is you could have a break point that get a hit on the request. You could e.g. add a method for Application_BeginRequest and there query RouteTable.Routes.GetRuteData with HttpContext.Current. Then you would see if any route handles the request and if so which.

An alternative to having the breakpoin is to use Developer Tool AddOn where you can type in a url and see which routes that matches.

Feb 27, 2014 9:25
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.