Export (0) Print
Expand All

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)

protected override IView CreatePartialView(
	ControllerContext controllerContext,
	string partialPath
)

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.

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.

Show:
© 2014 Microsoft