currently I'm developing on an older ASP.NET MVC 1 Application, to add theme support. I've looked around the web and was able to build my own ViewEngine which works quit nice so far. Only one problem is banging my had.
I've overwritten following method for WebFormViewEngine:
public override ViewEngineResult FindView(
ControllerContext controllerContext,
string viewName,
string masterName,
bool useCache)
In this method I'm setting up the location formats for the theme support. Unfortunately the masterName Parameter is always empty! So I need to check
if (string.IsNullOrEmpty(masterName))
masterName = "Site";
always by myself to get the engine working. But as I've several master files, this solution sucks, as soon as a view requires another master than "Site". Does anybody know, how I can get the master views name in this Method?