共用方式為


RazorViewEngineOptions.AreaPageViewLocationFormats 屬性

定義

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

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

適用於