Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

RazorView Constructor (ControllerContext, String, String, Boolean, IEnumerable<String>, IViewPageActivator)

Initializes a new instance of the RazorView class using the view page activator.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

public RazorView(
	ControllerContext controllerContext,
	string viewPath,
	string layoutPath,
	bool runViewStartPages,
	IEnumerable<string> viewStartFileExtensions,
	IViewPageActivator viewPageActivator
)

Parameters

controllerContext
Type: System.Web.Mvc.ControllerContext
The controller context.
viewPath
Type: System.String
The view path.
layoutPath
Type: System.String
The layout or master page.
runViewStartPages
Type: System.Boolean
A value that indicates whether view start files should be executed before the view.
viewStartFileExtensions
Type: System.Collections.Generic.IEnumerable<String>
The set of extensions that will be used when looking up view start files.
viewPageActivator
Type: System.Web.Mvc.IViewPageActivator
The view page activator.

View start files are layout files and master-page files. For example, view start files can include _ViewStart.cshtml in a C# ASP.NET MVC project and _ViewStart.vbhtml in a Visual Basic ASP.NET MVC project.

Show:
© 2015 Microsoft