RenderPartialExtensions.RenderPartial Method

Definition

Overloads

RenderPartial(HtmlHelper, String)

Renders the specified partial view by using the specified HTML helper.

RenderPartial(HtmlHelper, String, Object)

Renders the specified partial view, passing it a copy of the current ViewDataDictionary object, but with the Model property set to the specified model.

RenderPartial(HtmlHelper, String, ViewDataDictionary)

Renders the specified partial view, replacing its ViewData property with the specified ViewDataDictionary object.

RenderPartial(HtmlHelper, String, Object, ViewDataDictionary)

Renders the specified partial view, replacing the partial view's ViewData property with the specified ViewDataDictionary object and setting the Model property of the view data to the specified model.

RenderPartial(HtmlHelper, String)

Renders the specified partial view by using the specified HTML helper.

C#
public static void RenderPartial (this System.Web.Mvc.HtmlHelper htmlHelper, string partialViewName);

Parameters

htmlHelper
HtmlHelper

The HTML helper.

partialViewName
String

The name of the partial view

Applies to

ASP.NET MVC 5.2
Product Versions
ASP.NET MVC 5.2

RenderPartial(HtmlHelper, String, Object)

Renders the specified partial view, passing it a copy of the current ViewDataDictionary object, but with the Model property set to the specified model.

C#
public static void RenderPartial (this System.Web.Mvc.HtmlHelper htmlHelper, string partialViewName, object model);

Parameters

htmlHelper
HtmlHelper

The HTML helper.

partialViewName
String

The name of the partial view.

model
Object

The model.

Applies to

ASP.NET MVC 5.2
Product Versions
ASP.NET MVC 5.2

RenderPartial(HtmlHelper, String, ViewDataDictionary)

Renders the specified partial view, replacing its ViewData property with the specified ViewDataDictionary object.

C#
public static void RenderPartial (this System.Web.Mvc.HtmlHelper htmlHelper, string partialViewName, System.Web.Mvc.ViewDataDictionary viewData);

Parameters

htmlHelper
HtmlHelper

The HTML helper.

partialViewName
String

The name of the partial view.

viewData
ViewDataDictionary

The view data.

Applies to

ASP.NET MVC 5.2
Product Versions
ASP.NET MVC 5.2

RenderPartial(HtmlHelper, String, Object, ViewDataDictionary)

Renders the specified partial view, replacing the partial view's ViewData property with the specified ViewDataDictionary object and setting the Model property of the view data to the specified model.

C#
public static void RenderPartial (this System.Web.Mvc.HtmlHelper htmlHelper, string partialViewName, object model, System.Web.Mvc.ViewDataDictionary viewData);

Parameters

htmlHelper
HtmlHelper

The HTML helper.

partialViewName
String

The name of the partial view.

model
Object

The model for the partial view.

viewData
ViewDataDictionary

The view data for the partial view.

Applies to

ASP.NET MVC 5.2
Product Versions
ASP.NET MVC 5.2