c# - ASP.NET MVC Routing config issue -


I have an application in the application pool of IIS 7. I have added a new virtual directory in the application. My application is running and I would like to turn on my virtual directory because I want to do that virtual directory is used as an application. I would like to use virtual directory as a subsite. My problem is that I can not access controllers and ideas under the virtual directory. When I "Return View" ("/ Virtual Directory / View / Home / Index.cshtml") of the ActionResult Method; "I do not want the virtual directory's hard code on every return action result.

My root is config:

  public static zero registrations {routes. IgnoreRoute ("{} resource .axd / {* pathInfo}"); Routes MapRoute (name: "home", // root name url: "{id}", // URL parameter with default: new {controller = "Home", action = "index" / *, id = "" * / /} parameter defaults); routes ("default", // root name "{controller} / {action} / {id}", // Y New {controller = "home", action = "defoft", id = urp parameter} with optional RL parameter. Optional} / / parameter defaults);}  

I try to make the next change URL:

  Route URL with new {controller = "mapRoute" ("default", // root name "VirtualDirectory / {controller} / {action} / {ID}", // parameters. "Home", action = "defoft", id = url parameter. Option}} parameter defaults);  

But when I try to load You get the message:

HTTP error 403.14 - The prohibited web server is configured not to list the contents of this directory.

To run in the virtual directory, you do not need to change anything in your application's routing.

Although you still need to make sure that you do not use the relative path (absolute / based path) during your application, it is identical with any technique / always ignores the virtual directory.


Comments