routetable

RouteTable.Routes RouteCollection?

The example I see everywhere for MVC-style routing is something like this: void Application_Start(object sender, EventArgs e) { RegisterRoutes(RouteTable.Routes); } public static void RegisterRoutes(RouteCollection routes) { routes.Add(new Route ( "Category/{action}/{categoryName}" , new CategoryRouteHand...

How to define the RouteTable in VB.NET ?

[Route Table 1][1] This image shows how to define the RouteTable in C#, using the Route Class. How to define it in VB.NET? ...

ASP.NET MVC Routing two parameters with static string in between

This is my routing: routes.MapRoute(null, "shelves/{id1}/products/{action}/{id2}", new { controller = "Products", action = "List", id1 = "", id2 = ""}); The thought is that you can do something like this: http://server/shelves/23/products/edit/14 And be able to edit product 14 on shelf 23. Checking it with Route Debugger, t...

retrieve route values from RouteTable

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...

Can you register a controller against multiple URLs in asp.net mvc?

I want to create an MVC application where by I can create areas of a site that use the same functionality but work under a seperate URL. e.g. I want to use the same image gallery controller (type not instance) under two different URLs "/Event1/Gallery" and "ProductInformation/Gallery". However if I register this in the routes table and ...

Removing Specific Routes from ASP.NET 4 RoutesTable

hello everybody my site has many many routes. since the users can add or remove pages at will, i need a way to reregister the routes from time to time at reregister i do not want to clear the whole route cache ("RouteTable.Routes.Clear"), but i would rather go thru the table route by route, and using a certain regex on its name, decide...