Click or drag to resize
DefaultPathsProvider Class
This class is used as default by HandlebarsViewEngine to get the folder paths to be used when looking for views and other resources.
Inheritance Hierarchy
SystemObject
  HandlebarsDotNet.MvcDefaultPathsProvider

Namespace: HandlebarsDotNet.Mvc
Assembly: HandlebarsDotNet.Mvc (in HandlebarsDotNet.Mvc.dll) Version: 1.0.0-beta
Syntax
public class DefaultPathsProvider : IPathsProvider

The DefaultPathsProvider type exposes the following members.

Constructors
  NameDescription
Public methodDefaultPathsProvider
Initializes a new instance of the DefaultPathsProvider class
Top
Methods
  NameDescription
Public methodGetLayoutFolders
Gets the folders for where the layout files can be for the given ControllerContext. The paths returned are in the form "~/Views/_Layouts/".
Public methodGetPartialsFolders
Gets the folders for where the partials files can be for the given ControllerContext. The paths returned are in the form "~/Views/_Partials/".
Public methodGetViewFolders
Gets the folders for where the view files can be for the given ControllerContext. The paths returned are in the form "~/Views/Home/".
Top
Properties
  NameDescription
Public propertyAllowControllerlessViewFolder
Whether to allow view files to be located directly in the Views folder. Default: .
Public propertyAreasFolderName
The name of the folder where areas are located. Default: "Areas"
Public propertyLayoutsFolderName
The name of the folder where layouts are located. Default: "_Layouts"
Public propertyPartialsFolderName
The name of the folder where partials are located. Default: "_Partials"
Public propertySharedViewsFolderName
The folder name for shared view files (not specific to a certain controller). Set this to if you want to disable this functionality. Default: "_Shared"
Public propertyViewsFolderName
The name of the folder where views are located. Default: "Views"
Top
Remarks

The default folder paths for views are:

View Folder Path
(as returned by DefaultPathsProvider)
NoteExample view file path
(area: Users, controller: HomeController, action: Index)
~/Areas/{area}/Views/{controller}/Only if within an area.~/Areas/Users/Views/Home/Index.hbs
~/Areas/{area}/Views/_Shared/Only if within an area. Note that "_Shared" is configurable (can also be empty, and if so this is not returned).~/Areas/Users/Views/_Shared/Index.hbs
~/Areas/{area}/Views/Only if within an area, and only if AllowControllerlessViewFolder is .~/Areas/Users/Views/Index.hbs
~/Views/{controller}/~/Views/Home/Index.hbs
~/Views/_Shared/Note that "_Shared" is configurable (can also be empty, and if so this is not returned).~/Views/_Shared/Index.hbs
~/Views/Only if AllowControllerlessViewFolder is .~/Views/Index.hbs

The default folder paths for layouts are:

Layout Folder Path
(as returned by DefaultPathsProvider)
NoteExample layout file path
(area: Users, controller: HomeController, action: Index, layout: standard)
~/Areas/{area}/Views/{controller}/_Layouts/Only if within an area.~/Areas/Users/Views/Home/_Layouts/standard.hbs
~/Areas/{area}/Views/_Layouts/Only if within an area.~/Areas/Users/Views/_Layouts/standard.hbs
~/Views/{controller}/_Layouts/~/Views/Home/_Layouts/standard.hbs
~/Views/_Layouts/~/Views/_Layouts/standard.hbs

The default folder paths for partials are:

Partials Folder Path
(as returned by DefaultPathsProvider)
NoteExample partials file path
(area: Users, controller: HomeController, action: Index, partial: search)
~/Areas/{area}/Views/{controller}/_Partials/Only if within an area.~/Areas/Users/Views/Home/_Partials/search.hbs
~/Areas/{area}/Views/_Partials/Only if within an area.~/Areas/Users/Views/_Partials/search.hbs
~/Views/{controller}/_Partials/~/Views/Home/_Partials/search.hbs
~/Views/_Partials/~/Views/_Partials/search.hbs
See Also