.aspxビューを使用しているMVCWebサイトがあります。私はこの方法を使用してビューを見つけています:
public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
{
string skinName =
this.GetSkinName(controllerContext);
string controllerName =
controllerContext.RouteData.GetRequiredString("controller");
string viewPath =
this.GetPathFromGeneralName(this.ViewLocationFormats, viewName, controllerName, skinName);
string masterPath =
this.GetPathFromGeneralName(this.MasterLocationFormats, viewName, controllerName, skinName);
if (string.IsNullOrEmpty(viewPath))
{
IEnumerable<string> searchedLocations =
this.ViewLocationFormats.Union(this.MasterLocationFormats);
return new ViewEngineResult(searchedLocations);
}
return new ViewEngineResult(this.CreateView(controllerContext, viewPath, masterPath), this);
}
マスターページから継承されているビューがあります。その中にはアクションコントローラーへのハイパーリンクがありますが、そのビューはマスターページに接続されていません(私はそれを望まない)。(ハイパーリンクをクリックして)2番目のアクションのビューを表示しようとすると、上記のエラーメッセージが表示されます。他のコンテンツページを指している他のリンクがあり、それらは正常に機能しますが、スタンドアロンの.aspxページ(マスターページから継承されていない)にリンクできません。
何かアドバイス?