UserControl::TryUpdateModel<TModel> Method (TModel, IValueProvider^)

.NET Framework (current version)
 

Attempts to update the model instance using values from the value provider.

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

public:
generic<typename TModel>
where TModel : ref class
virtual bool TryUpdateModel(
	TModel model,
	IValueProvider^ valueProvider
)

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::Boolean

true if the model instance was updated successfully; otherwise, false.

Type Parameters

TModel

The type of the model object.

The TryUpdateModel<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
Return to top
Show: