Export (0) Print
Expand All

RenderPartialExtensions.RenderPartial Method

Renders the specified partial view control.

  NameDescription
Public method Static member RenderPartial(HtmlHelper, String) Renders the specified partial view by using the specified HMTL 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 a control (.ascx) 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. The partial view therefore 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.

Community Additions

Show:
© 2014 Microsoft