UserControl.UpdateModel 方法

定義

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

多載

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.

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 object.

參數

model
TModel

要更新的模型執行個體。The model instance to update.

例外狀況

未順利更新模型執行個體。The model instance was not updated successfully.

適用於

UpdateModel<TModel>(TModel, IValueProvider)

使用來自使用者控制項之值提供者的值,更新指定的模型執行個體。Updates the specified model instance using values from the value provider of the user control.

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 object.

參數

model
TModel

要更新的模型執行個體。The model instance to update.

valueProvider
IValueProvider

用來更新模型的值字典。A dictionary of values to use to update the model.

例外狀況

未順利更新模型執行個體。The model instance was not updated successfully.

適用於