RazorViewEngineOptions.PageViewLocationFormats 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.

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)

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

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

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

Applies to