What is the correct syntax for applying the RouteConfig.RegisterRoutes method in an ASP.NET MVC application if I want the application to ignore all the URLs starting with the word โratingโ, for example
http://myserver/score*.*
?
In other words, any URL starting with the text โratingโ I want my application to be ignored.
I tried:
routes.IgnoreRoute("score*.*/{*pathInfo}");
I also tried several other combinations of this syntax, but can't figure it out correctly.
Here is what I have so far found in my RouteConfig. This is pretty much standard material.
public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Order", action = "Add", id = UrlParameter.Optional } ); } }
source share