ModelMethodContext Class

.NET Framework (current version)
 

Used to invoke the Page.UpdateModel(Of TModel) or Page.TryUpdateModel(Of TModel) method when the Page object is not directly accessible.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

System.Object
  System.Web.UI.WebControls.ModelMethodContext

Public Class ModelMethodContext

NameDescription
System_CAPS_pubmethodModelMethodContext(Page)

Initializes a new instance of the ModelMethodContext class.

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticCurrent

Gets the ModelMethodContext object that corresponds to the Page object that is in the HttpContext.Current property.

System_CAPS_pubpropertyModelState

Gets the model state.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodTryUpdateModel(Of TModel)(TModel)

Updates the specified model instance using values from a value provider.

System_CAPS_pubmethodTryUpdateModel(Of TModel)(TModel, IValueProvider)

Updates the specified model instance using values from the specified value provider.

System_CAPS_pubmethodUpdateModel(Of TModel)(TModel)

Updates the specified model instance using values from a value provider.

System_CAPS_pubmethodUpdateModel(Of TModel)(TModel, IValueProvider)

Updates the specified model instance using values from the specified value provider.

For example, a custom class can define the methods referred to by the SelectMethod, UpdateMethod, DeleteMethod, and InsertMethod properties for data binding, and those methods can have a parameter of this type and use it to invoke the UpdateModel(Of TModel) method. Alternatively, instead of a method parameter, the Current property can be used within a method to invoke the UpdateModel(Of TModel) method.

For a tutorial series on using model binding with Web Forms, see Model Binding and Web Forms.

.NET Framework
Available since 4.5

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: