Dela via


RazorViewEngineOptions.AreaPageViewLocationFormats Property

Definition

Gets the locations where RazorViewEngine will search for views (such as layouts and partials) when searched from the context of rendering a Razor Page within an area.

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)

Property Value

Remarks

Locations are format strings (see https://msdn.microsoft.com/en-us/library/txafckwd.aspx) which may contain the following format items:

  • {0} - View Name
  • {1} - Page Name
  • {2} - Area Name

AreaPageViewLocationFormats work in tandem with a view location expander to perform hierarchical path lookups. For instance, given a Page like /Areas/Account/Pages/Manage/User.cshtml using /Areas as the area pages root and /Pages as the root, the view engine will search for views in the following locations:

/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

Applies to