hi, i want retrieve route values from RouteTable, but it's null. can anybody help?
public static class GetRouteValues
{
public static string GetSomeValue()
{
RouteCollection routes = RouteTable.Routes;
var value = routes["somevalue"].ToString();
return value;
}
}
i want retrieve this value for using in global.asax file and set as default value for some routes value.
string value = GetRouteValues.GetSomeValue();
routes.MapRoute(null,
"{_value}/home",
new
{
_value = value,
controller = "home",
action = "index"
});