I have a legacy url that I wish to map to a route in my ASP.Net MVC application
e.g. http://my.domain.com/article/?action=detail&item=22
<
controller,action and area are the only reserved words in asp.net MVC. "Reserved" means that MVC gives special meaning to them, especially for Routing.
There are also others words (COM1-9, LPT1-9, AUX, PRT, NUL, CON), not specific to asp.net, than can not be in the url. This is explained why here and how to by-pass here.
Edit : There are no ways to use them because asp.net mvc relies on them in route data.
Here is an decompiled example taken from UrlHelper :
// System.Web.Mvc.RouteValuesHelpers
public static RouteValueDictionary MergeRouteValues(string actionName, string controllerName, RouteValueDictionary implicitRouteValues, RouteValueDictionary routeValues, bool includeImplicitMvcValues)
{
RouteValueDictionary routeValueDictionary = new RouteValueDictionary();
if (includeImplicitMvcValues)
{
object value;
if (implicitRouteValues != null && implicitRouteValues.TryGetValue("action", out value))
{
routeValueDictionary["action"] = value;
}
if (implicitRouteValues != null && implicitRouteValues.TryGetValue("controller", out value))
{
routeValueDictionary["controller"] = value;
}
}
if (routeValues != null)
{
foreach (KeyValuePair current in RouteValuesHelpers.GetRouteValues(routeValues))
{
routeValueDictionary[current.Key] = current.Value;
}
}
if (actionName != null)
{
routeValueDictionary["action"] = actionName;
}
if (controllerName != null)
{
routeValueDictionary["controller"] = controllerName;
}
return routeValueDictionary;
}