Let's say I want to redirect all requests in / js / * to the Index JavaScript controller. In other words, these routes should call JavaScriptController.Index() :
/js/root/index.css /js/user/account/index.css /js/master.css
What will be the route definition in my Global.asax.cs file?
This does not work:
routes.MapRoute("JavaScript", "js/{*path}", new { controller = "JavaScriptController", action = "Index" });
The breakpoint is never called during debug mode with:
public class JavaScriptController : Controller { [HttpGet] public void Index(string path) { var browser = HttpContext.Request.Browser; System.Diagnostics.Debugger.Break(); } }
Did I miss something?
source share