Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Page.TryUpdateModel<TModel> Method (TModel, IValueProvider)

.NET Framework 4.6 and 4.5

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

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

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

Type Parameters

TModel

The type of the model.

Parameters

model
Type: TModel

The model.

valueProvider
Type: System.Web.ModelBinding.IValueProvider

The value provider.

Return Value

Type: System.Boolean
true if model binding is successful; otherwise, false.

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

.NET Framework

Supported in: 4.6, 4.5
Show:
© 2015 Microsoft