Export (0) Print
Expand All

RenderPartialExtensions.RenderPartial Method

Renders the specified partial-view control.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method Static member RenderPartial(HtmlHelper, String) Renders the specified partial view by using the specified HTML helper.
Public method Static member 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.
Public method Static member RenderPartial(HtmlHelper, String, ViewDataDictionary) Renders the specified partial view, replacing its ViewData property with the specified ViewDataDictionary object.
Public method Static member 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.
Top

The RenderPartial method renders an ASP.NET user control (.ascx file) as a partial view.

When a partial view is instantiated, it gets its own copy of the ViewDataDictionary object that is available to the parent view. Therefore, the partial view has access to the data of the parent view. However, if the partial view updates the data, those updates affect only the partial view's ViewData object. The parent view's data is not changed.

Show:
© 2014 Microsoft