Reputation: 5524
I have a topLevel folder with a subFolder holding ControllerName. When I enter:
http://localhost/FolderName/FolderName/ControllerName
how do i tell mvc to account for the folder depth?
thx
Upvotes: 0
Views: 604
Reputation: 11127
You'll need to configure your routes in Global.asax.cs. It doesn't actually matter physically where your controller is stored, but it should probably be in the /Controllers folder in your project.
Something like this in the RegisterRoutes method:
routes.MapRoute(
"RouteName", // Route name
"FolderName/FolderName/{controller}", // URL with parameters
new { controller = "ControllerName", action = "Index", url = "" } // Parameter defaults
);
Put it before the other routes as it is quite specific.
Upvotes: 2