Page.TryUpdateModel<TModel> Method (TModel)

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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

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

public virtual bool TryUpdateModel<TModel>(
	TModel model
where TModel : class


Type: TModel

The model.

Return Value

Type: System.Boolean

true if model binding is successful; otherwise, false.

Type Parameters


The type of the model.

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.

.NET Framework
Available since 4.5
Return to top