RazorViewEngineOptions.PageViewLocationFormats 屬性

定義

取得從 RazorViewEngine 轉譯 Razor 頁面的內容搜尋檢視 (的位置,例如版面配置和部分) 。

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

屬性值

備註

位置是格式字串, (請參閱 https://msdn.microsoft.com/en-us/library/txafckwd.aspx 可能包含下列格式專案的) :

  • {0} - 檢視名稱
  • {1} - 頁面名稱

PageViewLocationFormats 與檢視位置展開器搭配運作,以執行階層式路徑查閱。 例如,假設使用 /Pages 作為根目錄使用 /Account/Manage/Index 等頁面,檢視引擎將會在下列位置搜尋檢視:

/Pages/Account/Manage/ {0} .cshtml /Pages/Account/ {0} .cshtml /Pages/ {0} .cshtml /Pages/Shared/ {0} .cshtml /Views/Shared/ {0} .cshtml

適用於