Если вы хотите изменить правило поиска партиалов, vieww или masterpages, вам нужно изменить ViewEngine.
public class ChangedWebFormViewEngine : WebFormViewEngine
{
private static string[] LocalViewFormats =
new string[] {
"~/Views/{1}/OtherPath/{0}.aspx",
"~/Views/{1}/{0}.aspx",
"~/Views/{1}/{0}.ascx",
"~/Views/Shared/{0}.aspx",
"~/Views/Shared/{0}.ascx"
};
public LocalizationWebFormViewEngine()
{
base.ViewLocationFormats = LocalViewFormats;
base.PartialViewLocationFormats = LocalViewFormats;
base.MasterLocationFormats = new string[] {
"~/Views/{1}/OtherPath/{0}.master",
"~/Views/{1}/{0}.master",
"~/Views/Shared/OtherPath/{0}.master",
"~/Views/Shared/{0}.master"
};
}
protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath)
{
return new LocalizationWebFormView(viewPath, masterPath);
}
protected override IView CreatePartialView(ControllerContext controllerContext, string partialPath)
{
return new LocalizationWebFormView(partialPath, null);
}
}