When a user comes to my site, the query string may be template=foo. This value is checked and stored in Session.
My file layout is as follows:
- Views/
- Templates/
- test1/
- Home
- Index.cshtml
- test2/
- Home
- List.cshtml
- Home/
- Index.cshtml
Basically, if a user requests Indexwith template=test1, I want to use Views/Templates/test1/Index.cshtml. If they have template=test2, I want to use Views/Home/Index.cshtml(because it /Views/Templates/test2/Home/Index.cshtmldoes not exist). And if they do not pass the pattern, then it should go directly to Views/Home.
I'm new to MVC and .NET in general, so I'm not sure where to start looking. I use MVC3 and Razor for the viewing engine.
source
share