Page.UpdateModel Page.UpdateModel Page.UpdateModel Page.UpdateModel Method

定義

使用來自值提供者的值更新指定的模型執行個體。Updates the specified model instance using values from a value provider.

多載

UpdateModel<TModel>(TModel) UpdateModel<TModel>(TModel) UpdateModel<TModel>(TModel) UpdateModel<TModel>(TModel)

使用資料繫結控制項的值來更新指定的模型執行個體。Updates the specified model instance using values from the data-bound control.

UpdateModel<TModel>(TModel, IValueProvider) UpdateModel<TModel>(TModel, IValueProvider) UpdateModel<TModel>(TModel, IValueProvider) UpdateModel<TModel>(TModel, IValueProvider)

使用來自指定的值提供者的值更新指定的模型執行個體。Updates the specified model instance using values from a specified value provider.

備註

如需搭配 Web Forms 使用模型系結的教學課程系列,請參閱模型系結和 webform。For a tutorial series on using model binding with Web Forms, see Model Binding and Web Forms.

UpdateModel<TModel>(TModel) UpdateModel<TModel>(TModel) UpdateModel<TModel>(TModel) UpdateModel<TModel>(TModel)

使用資料繫結控制項的值來更新指定的模型執行個體。Updates the specified model instance using values from the data-bound control.

public:
generic <typename TModel>
 where TModel : class virtual void UpdateModel(TModel model);
public virtual void UpdateModel<TModel> (TModel model) where TModel : class;
abstract member UpdateModel : 'Model -> unit (requires 'Model : null)
override this.UpdateModel : 'Model -> unit (requires 'Model : null)
Public Overridable Sub UpdateModel(Of TModel As Class) (model As TModel)

類型參數

TModel

模型的型別。The type of the model.

參數

model

模型。The model.

備註

這個方法只能從資料繫結控制項的UpdateMethodInsertMethod屬性所指定的方法呼叫。This method should only be called from a method that is specified by a data-bound control's UpdateMethod or InsertMethod property.

如需搭配 Web Forms 使用模型系結的教學課程系列,請參閱模型系結和 webform。For a tutorial series on using model binding with Web Forms, see Model Binding and Web Forms.

UpdateModel<TModel>(TModel, IValueProvider) UpdateModel<TModel>(TModel, IValueProvider) UpdateModel<TModel>(TModel, IValueProvider) UpdateModel<TModel>(TModel, IValueProvider)

使用來自指定的值提供者的值更新指定的模型執行個體。Updates the specified model instance using values from a specified value provider.

public:
generic <typename TModel>
 where TModel : class virtual void UpdateModel(TModel model, System::Web::ModelBinding::IValueProvider ^ valueProvider);
public virtual void UpdateModel<TModel> (TModel model, System.Web.ModelBinding.IValueProvider valueProvider) where TModel : class;
abstract member UpdateModel : 'Model * System.Web.ModelBinding.IValueProvider -> unit (requires 'Model : null)
override this.UpdateModel : 'Model * System.Web.ModelBinding.IValueProvider -> unit (requires 'Model : null)
Public Overridable Sub UpdateModel(Of TModel As Class) (model As TModel, valueProvider As IValueProvider)

類型參數

TModel

模型的型別。The type of the model.

參數

model

模型。The model.

valueProvider
IValueProvider IValueProvider IValueProvider IValueProvider

值提供者。The value provider.

備註

如需搭配 Web Forms 使用模型系結的教學課程系列,請參閱模型系結和 webform。For a tutorial series on using model binding with Web Forms, see Model Binding and Web Forms.

適用於