mvcroutehandler

ASP.NET MVC 5: single controller method to handle paths in file browser mode

我的未来我决定 提交于 2020-01-06 19:52:33
问题 I want to have some controller with the single method that would allow me to navigate through some hierarchy (file system etc.). In other words I want to have possibility to access this method with flexible routes and get part of routes as parameter. For example in case of this hierarchy Root Sub-folder-A Sub-folder-B Sub-folder-C I want to have access folders with the next routes mymvcapplication/explorer/root mymvcapplication/explorer/root/sub-folder-a mymvcapplication/explorer/root/sub

MVC3 RouteHandler result ignores Area in the resolved Route - why?

元气小坏坏 提交于 2019-12-12 02:41:22
问题 I am working on splitting an MVC3 Application into two Areas. The existing application is going into one area (V1) and we are beginning a redesign in the second area (V2). I have the Views, Models, Controllers, etc all moved into the MyApp\Areas\V1\xxx folders, and I have been able to verify that things are loading as they should for the most part. I moved all the Route registration for V1 into the V1AreaRegistration.cs file, and modified it to use context.MapRoute instead of RouteTable

MVC.NET Custom Root Handler Wrong action in Html:BeginForm

好久不见. 提交于 2019-12-11 19:33:11
问题 I used custom mvc route handler. But When I use Html.BeginForm or Ajax.BeginForm in the view, Action parameters change unexpectedly. My codes are above My Register Route method is : public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute("alias", "{alias}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ).RouteHandler = new FriendlyUrlRoutehandler(); routes.MapRoute

MVC 4: Custom Route & Html.Action out of synch

被刻印的时光 ゝ 提交于 2019-12-10 12:23:39
问题 So I have this custom route, which sets up the route table based on culture in the URL, but when I call Url.Action(...), it does not generate the localized URL. Any ideas what I'm doing wrong? The culture is changing on the page and I am able to determine what language user has selected, but Url.Action is not generating localized URL.. This is the custom route, which changes the route table values (not sure if this standard way of doing it): public class CultureRoute : Route { public