In ASP.NET MVC2,
How do I change routing/folder structure so I can have
- Views\FOLDER\Account\ChangePass.aspx
Rather than:
- Views\Account\ChangePass.aspx
I don’t actually want to do it for the account, but I’d like to structure things like that, e.g.
SO I can have two different views like:
-
Views\Categories\
-
Views\Admin\Categories\
These would display completely differently.
All I want to do is to be able to create my own subfolders to push the views into, not a seperate folder for each different controller………………………………………………………
Go with the asp.net MVC convention for view location; if you want to have different url paths you need to look at creating your own routes, other than the default single route given to you. (See this primer.)
Here’s an example of a route that you might add in your Global.asax to have the desired result but you’ll have to map this route to a controller action appropriately. Really, your need to decide on the pattern to meet the need of your app…