UserControl.TryUpdateModel(Of TModel) Method (TModel, IValueProvider)
.NET Framework (current version)
Attempts to update the model instance using values from the value provider.
Assembly: System.Web (in System.Web.dll)
Public Overridable Function TryUpdateModel(Of TModel As Class) ( model As TModel, valueProvider As IValueProvider ) As Boolean
Parameters
- model
-
Type:
TModel
The model instance to update.
- valueProvider
-
Type:
System.Web.ModelBinding.IValueProvider
A dictionary of values to use to update the model.
Return Value
Type: System.Booleantrue if the model instance was updated successfully; otherwise, false.
Type Parameters
- TModel
The type of the model object.
The TryUpdateModel(Of TModel) method must be invoked from inside a data-operation method of the control using the ModelType property for data binding.
.NET Framework
Available since 4.5
Available since 4.5
Show: