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
controllerContextControllerContextThe controller context.
viewPathstringThe view path.
layoutPathstringThe layout or master page.
runViewStartPagesboolA value that indicates whether view start files should be executed before the view.
viewStartFileExtensionsIEnumerable<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
controllerContextControllerContextThe controller context.
viewPathstringThe view path.
layoutPathstringThe layout or master page.
runViewStartPagesboolA value that indicates whether view start files should be executed before the view.
viewStartFileExtensionsIEnumerable<string>The set of extensions that will be used when looking up view start files.
viewPageActivatorIViewPageActivatorThe 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
viewContextViewContextThe view context.
writerTextWriterThe writer that is used to render the view to the response.
instanceobjectThe WebViewPage instance.