RazorViewEngineOptions.AreaPageViewLocationFormats プロパティ

定義

エリア内で Razor ページをレンダリングするコンテキストから検索した場合にビュー (レイアウトや部分など) を検索する場所 RazorViewEngine を取得します。

public:
 property System::Collections::Generic::IList<System::String ^> ^ AreaPageViewLocationFormats { System::Collections::Generic::IList<System::String ^> ^ get(); };
public System.Collections.Generic.IList<string> AreaPageViewLocationFormats { get; }
member this.AreaPageViewLocationFormats : System.Collections.Generic.IList<string>
Public ReadOnly Property AreaPageViewLocationFormats As IList(Of String)

プロパティ値

注釈

場所は、次の書式指定項目を含む書式指定文字列 (を参照 https://msdn.microsoft.com/en-us/library/txafckwd.aspx) です。

  • {0} - ビュー名
  • {1} - ページ名
  • {2} - エリア名

AreaPageViewLocationFormats は、ビューの位置エキスパンダーと連携して作業し、階層パス参照を実行します。 たとえば、/Areas/Account/Pages/Manage/User.cshtml のようなページでエリア ページのルートとして /Areas を使用し、/Pages をルートとして使用すると、ビュー エンジンは次の場所でビューを検索します。

/Areas/Accounts/Pages/Manage/{0}.cshtml /Areas/Accounts/Pages/{0}.cshtml /Areas/Accounts/Pages/Shared/{0}.cshtml /Areas/Accounts/Views/Shared/{0}.cshtml /Pages/Shared/{0}.cshtml /Views/Shared/{0}.cshtml

適用対象