Hi,
You can override the FindPartialView and FindView methods to ensure that your view will be found from your view locations. Something like this:
public override ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache)
{
ViewEngineResult viewEngineResult = base.FindPartialView(controllerContext, partialViewName, useCache);
if (useCache && viewEngineResult.View == null)
{
viewEngineResult = base.FindPartialView(controllerContext, partialViewName, false);
}
return viewEngineResult;
}
public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
{
ViewEngineResult viewEngineResult = base.FindView(controllerContext, viewName, masterName, useCache);
if (useCache && viewEngineResult.View == null)
{
viewEngineResult = base.FindView(controllerContext, viewName, masterName, false);
}
return viewEngineResult;
}