Page.UpdateModel Method

Definition

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

Overloads

UpdateModel<TModel>(TModel)

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

UpdateModel<TModel>(TModel, IValueProvider)

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

Remarks

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

UpdateModel<TModel>(TModel)

Updates the specified model instance 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.

Parameters

model
TModel

The model.

Remarks

This method should only be called from a method that is specified by a data-bound control's UpdateMethod or InsertMethod property.

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

Applies to

.NET Framework 4.8.1 and other versions
Product 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 a specified value provider.

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

Type Parameters

TModel

The type of the model.

Parameters

model
TModel

The model.

valueProvider
IValueProvider

The value provider.

Remarks

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

Applies to

.NET Framework 4.8.1 and other versions
Product 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