UserControl.UpdateModel Method

Definition

Updates the model instance by using values from the data-bound control.

Overloads

UpdateModel<TModel>(TModel)

Updates the model instance by using values from the data-bound control.

UpdateModel<TModel>(TModel, IValueProvider)

Updates the specified model instance using values from the value provider of the user control.

UpdateModel<TModel>(TModel)

Updates the model instance by using values from the data-bound control.

C#
public virtual void UpdateModel<TModel> (TModel model) where TModel : class;

Type Parameters

TModel

The type of the model object.

Parameters

model
TModel

The model instance to update.

Exceptions

The model instance was not updated successfully.

Applies to

.NET Framework 4.8.1 et autres versions
Produit Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

UpdateModel<TModel>(TModel, IValueProvider)

Updates the specified model instance using values from the value provider of the user control.

C#
public virtual void UpdateModel<TModel> (TModel model, System.Web.ModelBinding.IValueProvider valueProvider) where TModel : class;

Type Parameters

TModel

The type of the model object.

Parameters

model
TModel

The model instance to update.

valueProvider
IValueProvider

A dictionary of values to use to update the model.

Exceptions

The model instance was not updated successfully.

Applies to

.NET Framework 4.8.1 et autres versions
Produit Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1