RazorViewEngine.CreatePartialView Method
Creates a partial view using the specified controller context and partial path.
Namespace: System.Web.Mvc
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
Syntax
'Declaration
Protected Overrides Function CreatePartialView ( _
controllerContext As ControllerContext, _
partialPath As String _
) As IView
'Usage
Dim controllerContext As ControllerContext
Dim partialPath As String
Dim returnValue As IView
returnValue = Me.CreatePartialView(controllerContext, _
partialPath)
protected override IView CreatePartialView(
ControllerContext controllerContext,
string partialPath
)
protected:
virtual IView^ CreatePartialView(
ControllerContext^ controllerContext,
String^ partialPath
) override
protected override function CreatePartialView(
controllerContext : ControllerContext,
partialPath : String
) : IView
Parameters
- controllerContext
Type: System.Web.Mvc.ControllerContext
The controller context.
- partialPath
Type: System.String
The path to the partial view.
Return Value
Type: System.Web.Mvc.IView
The partial view.
Remarks
Partial views are reusable components of a view. Partial views are able to get the data to display from the ViewData object of the parent, or through the use of the model that was passed into the partial view. Because partial views are intended to be only a partial rendering of the view, there is no concept of a master view for partial views.
Partial views can use a different view engine than the view in which they are rendered.