Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

RenderPartialExtensions::RenderPartial Method (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.

Namespace:  System.Web.Mvc.Html
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)
[ExtensionAttribute]
public:
static void RenderPartial(
	HtmlHelper^ htmlHelper, 
	String^ partialViewName, 
	Object^ model
)

Parameters

htmlHelper
Type: System.Web.Mvc::HtmlHelper
The HTML helper.
partialViewName
Type: System::String
The name of the partial view.
model
Type: System::Object
The model.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HtmlHelper. When you use instance method syntax to call this method, omit the first parameter. For more information, see http://msdn.microsoft.com/en-us/library/bb384936.aspx or http://msdn.microsoft.com/en-us/library/bb383977.aspx.

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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.