RazorViewEngineOptions.ViewLocationFormats Property

Definition

Gets the locations where RazorViewEngine will search for views.

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

Property Value

IList<String>

Remarks

The locations of the views returned from controllers that do not belong to an area. Locations are format strings (see https://msdn.microsoft.com/en-us/library/txafckwd.aspx) which may contain the following format items:

  • {0} - Action Name
  • {1} - Controller Name

The values for these locations are case-sensitive on case-sensitive file systems. For example, the view for the Test action of HomeController should be located at /Views/Home/Test.cshtml. Locations such as /views/home/test.cshtml would not be discovered.

Applies to