DefaultModelBinder 類別

定義

將瀏覽器要求對應至資料物件。 這個類別提供模型繫結器的具體實作。

public class DefaultModelBinder : System.Web.Mvc.IModelBinder
type DefaultModelBinder = class
    interface IModelBinder
Public Class DefaultModelBinder
Implements IModelBinder
繼承
DefaultModelBinder
實作

建構函式

DefaultModelBinder()

初始化 DefaultModelBinder 類別的新執行個體。

屬性

Binders

取得或設定應用程式的模型繫結器。

ResourceClassKey

取得或設定包含當地語系化字串值的資源檔名稱 (類別機碼)。

方法

BindModel(ControllerContext, ModelBindingContext)

使用指定的控制器內容和繫結內容來繫結模型。

BindProperty(ControllerContext, ModelBindingContext, PropertyDescriptor)

使用指定的控制器內容、繫結內容和指定的屬性描述元,繫結指定的屬性。

CreateModel(ControllerContext, ModelBindingContext, Type)

使用指定的控制器內容和繫結內容,建立指定的模型型別。

CreateSubIndexName(String, Int32)

根據構成更大索引之元件的分類來建立索引 (子索引),其中指定的索引值是整數。

CreateSubIndexName(String, String)

根據構成更大索引之元件的分類來建立索引 (子索引),其中指定的索引值是字串。

CreateSubPropertyName(String, String)

使用指定的前置字元和屬性名稱,建立子屬性的名稱。

GetFilteredModelProperties(ControllerContext, ModelBindingContext)

傳回一組符合所指定 binding context 所建立之屬性篩選準則限制的屬性。

GetModelProperties(ControllerContext, ModelBindingContext)

使用指定的控制器內容和繫結內容,傳回模型的屬性。

GetPropertyValue(ControllerContext, ModelBindingContext, PropertyDescriptor, IModelBinder)

使用指定的控制器內容、繫結內容、屬性描述元和屬性繫結器,傳回屬性的值。

GetTypeDescriptor(ControllerContext, ModelBindingContext)

針對以控制器內容和繫結內容所指定的型別,傳回描述元物件。

IsModelValid(ModelBindingContext)

判斷資料模型對指定之繫結內容而言是否有效。

OnModelUpdated(ControllerContext, ModelBindingContext)

當模型已更新時呼叫。

OnModelUpdating(ControllerContext, ModelBindingContext)

當模型正在更新時呼叫。

OnPropertyValidated(ControllerContext, ModelBindingContext, PropertyDescriptor, Object)

當指定的屬性已驗證時呼叫。

OnPropertyValidating(ControllerContext, ModelBindingContext, PropertyDescriptor, Object)

當指定的屬性正在驗證時呼叫。

SetProperty(ControllerContext, ModelBindingContext, PropertyDescriptor, Object)

使用指定的控制器內容、繫結內容和屬性值,設定指定的屬性。

適用於