Class RazorView
Represents the class used to create views that have Razor syntax.
public class RazorView : BuildManagerCompiledView, IView
- Inheritance
-
RazorView
- Implements
- Inherited Members
Constructors
RazorView(ControllerContext, string, string, bool, IEnumerable<string>)
Initializes a new instance of the RazorView class.
public RazorView(ControllerContext controllerContext, string viewPath, string layoutPath, bool runViewStartPages, IEnumerable<string> viewStartFileExtensions)
Parameters
controllerContext
ControllerContextThe controller context.
viewPath
stringThe view path.
layoutPath
stringThe layout or master page.
runViewStartPages
boolA value that indicates whether view start files should be executed before the view.
viewStartFileExtensions
IEnumerable<string>The set of extensions that will be used when looking up view start files.
RazorView(ControllerContext, string, string, bool, IEnumerable<string>, IViewPageActivator)
Initializes a new instance of the RazorView class using the view page activator.
public RazorView(ControllerContext controllerContext, string viewPath, string layoutPath, bool runViewStartPages, IEnumerable<string> viewStartFileExtensions, IViewPageActivator viewPageActivator)
Parameters
controllerContext
ControllerContextThe controller context.
viewPath
stringThe view path.
layoutPath
stringThe layout or master page.
runViewStartPages
boolA value that indicates whether view start files should be executed before the view.
viewStartFileExtensions
IEnumerable<string>The set of extensions that will be used when looking up view start files.
viewPageActivator
IViewPageActivatorThe view page activator.
Properties
LayoutPath
Gets the layout or master page.
public string LayoutPath { get; }
Property Value
- string
The layout or master page.
RunViewStartPages
Gets a value that indicates whether view start files should be executed before the view.
public bool RunViewStartPages { get; }
Property Value
- bool
A value that indicates whether view start files should be executed before the view.
ViewStartFileExtensions
Gets or sets the set of file extensions that will be used when looking up view start files.
public IEnumerable<string> ViewStartFileExtensions { get; }
Property Value
- IEnumerable<string>
The set of file extensions that will be used when looking up view start files.
Methods
RenderView(ViewContext, TextWriter, object)
Renders the specified view context by using the specified writer and WebViewPage instance.
protected override void RenderView(ViewContext viewContext, TextWriter writer, object instance)
Parameters
viewContext
ViewContextThe view context.
writer
TextWriterThe writer that is used to render the view to the response.
instance
objectThe WebViewPage instance.