Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ViewDataDictionary.SetModel Method

.NET Framework 4

Sets the data model to use for the view.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)
protected virtual void SetModel(
	Object value
)

Parameters

value
Type: System.Object
The data model to use for the view.

This method executes before the derived type's instance constructor executes. Derived types must account for this. For example, the logic in the SetModel method must be simple enough that it does not depend on the this pointer (Me in Visual Basic) to reference a fully constructed object.

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.