Hi,
i have a website that will have customized designs, depending on what "store" was clicked on...
So, i have a folder structure like:
+ _default
- Site.Master
- Site.css
+ Views
- main.ascx
- xyz.ascx
- zbf.aspx
+ custom_design_01
- Site.Master
- Site.css
+ Views
- xyz.ascx
- zbf.aspx
+ custom_design_02
- Site.Master
- Site.css
+ Views
- xyz.ascx
- zbf.aspx
In my controller i will make the decision which of the folders to use, depending on a parameter from the request ( the default folder should be used when a file is not available as customized one.. )
So, the controller has do something like:
public ActionResult Index(int id)
{
var newRouteParamThatWouldntFitIntoTheCurrentViewMethodLikeThis = DoSomeMagicalRoutingStuff(id);
return View(newRouteParamThatWouldntFitIntoTheCurrentViewMethodLikeThis);
//return View();
}
If i hadn't the "dynamic routing per request" requirement here, i could have used a customized ViewEngine or something...
Does anyone has an idea on how to realize this ( with MVC on-board tools )? I really want to keep using the Html.RenderPartial method and other "benefits" of the MVC... that's why i'd prefer solving this problem with MVC methods/overrides/etc.
Update:
- The sites are different in design, content, using "RenderPartial" theirself and so on..
- The views are really different.. not just the masterpages..
- The ID parameter in the controller is identifying which "folder" should be used ( e.g. custom_design_01 )
- The URLs will look like: "/Stores/{id_of_design}/" which calls the example controller method.. the ctonroller then returns the view "/Stores/{id_of_design}/Views/zbf.aspx" for example
Thanks!