I want to have multiple path folder structure that contain same name views:
/profile.aspx
/admin/profile.aspx
/user/editpost.aspx
/admin/editpost.aspx
/Controllers
|- PostController.cs
|- ProfileController.cs
I want to be able to have all the regular pages in a folder and the admin pages in another folder. Do I need to organize my Views folder like:
/Views
/User
/Story
|- editpost.aspx
/Profile
|- profile.aspx
/Admin
/Story
|_ editpost.aspx
/Web
|- profile.aspx
or is there a way I can do this:
/User
/Views
/Story
|- editpost.aspx
/Profile
|- profile.aspx
/Admin
/Views
/Story
|_ editpost.aspx
/Web
|- profile.aspx
Also, how do I code/organize/use separate controllers for /User and /Admin that potentially have the same name?
Let me know if I have been unclear.
Thanks!
No problem. You can organise your folders in any way you choose. You can specify a view by name or even by its path in the Action method:
return View("~/Views/Posts/Index.aspx");
You should read this post by Phil Haack.
Basically, you're gonna have to create your own ViewEngine to work with your folder design.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With