Export (0) Print
Expand All

ViewDataDictionary<TModel>.SetModel Method

Sets the model.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

protected override void SetModel(
	Object value
)

Parameters

value
Type: System.Object
The value.

ExceptionCondition
InvalidOperationException

An error occurred while the model was being set.

This method executes before the derived type's instance constructor executes. Derived types must take this into consideration. For example, the logic in the SetModel method must not depend on the this pointer (Me in Visual Basic) to reference a fully constructed object.

Community Additions

Show:
© 2014 Microsoft