RazorViewEngine.CreatePartialView Method (ControllerContext, String)


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
virtual IView^ CreatePartialView(
    ControllerContext^ controllerContext,
    String^ partialPath
) override
override CreatePartialView : 
        controllerContext:ControllerContext *
        partialPath:string -> IView
Protected Overrides Function CreatePartialView (
    controllerContext As ControllerContext,
    partialPath As String
) As IView


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.

See Also

RazorViewEngine Class
System.Web.Mvc Namespace

Return to top