When a user comes to my site, there may be a template=foo
passed in the query string. This value is being verified and stored in the Session
.
My file layout looks like this:
- Views/
- Templates/
- test1/
- Home
- Index.cshtml
- test2/
- Home
- List.cshtml
- Home/
- Index.cshtml
Basically, if a user requests Index
with 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 /Views/Templates/test2/Home/Index.cshtml
doesn't exist). And if they do not pass a template, 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'm using MVC3 and Razor for the view engine.