I was wondering if you could show me all the various ways to declare routes in ASP.NET MVC (1 and 2). Please explain each method of defining a route, how it is used, and what case it covers.
Here is an example of what I am hoping to collect here:
routes.MapRoute("Directors",
"Directors/{filter}/{skip}",
new { controller = "Directors", action = "Index", skip = 0, filter = "" },
new { skip = @"\d+", filter = @"^[a-zA-Z]+.+" });
Directors
= the name of the route. Directors/{filter}/{skip}
= the url definition. new { controller = "Directors", action = "Index", skip = 0, filter = "" }
= the default for this route. new { skip = @"\d+", filter = @"^[a-zA-Z]+.+" }
= the constraints for this route.