I am dealing with this code in a Web Forms scenario:
public static void RegisterRoutes(RouteCollection routes)
{
Route r = new Route("{*url}", new MyRouteHandler());
routes.Add(r);
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.gif/{*pathInfo}");
}
Firstly, can anyone tell me where the defintion of {*pathInfo} is? http://msdn.microsoft.com/en-us/library/cc668201.aspx#url_patterns doesn't really define it. Does:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
Match
/c/xyz.axd and
/b/c/xyz.axd and
/a/b/c/xyz.axd
Whereas
routes.IgnoreRoute("{resource}.axd");
Only matches
/xyz.axd
Secondly, in:
{*url}
What does * mean? And what does the expression as a whole mean. Is there somewhere this is clearly explained?
Thirdly, is there a particular order I need to add these expressions to correctly ignore routes? I know {*url} is some kind of catchall, should the IgnoreRoutes come before or after it eg
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.gif/{*pathInfo}");
Route r = new Route("{*url}", new MyRouteHandler());
routes.Add(r);