ModelDataSource 類別

定義

使用模型繫結時,資料繫結控制項用於執行 CRUD (建立、讀取、更新、刪除) 作業的資料來源控制項。The data source control used by data-bound controls to perform CRUD (create, read, update, delete) operations when model binding is in use.

public ref class ModelDataSource : System::Web::UI::IDataSource, System::Web::UI::IStateManager
public class ModelDataSource : System.Web.UI.IDataSource, System.Web.UI.IStateManager
type ModelDataSource = class
    interface IDataSource
    interface IStateManager
Public Class ModelDataSource
Implements IDataSource, IStateManager
繼承
ModelDataSource
實作

建構函式

ModelDataSource(Control)

初始化 ModelDataSource 類別的新執行個體。Initializes a new instance of the ModelDataSource class.

屬性

DataControl

取得模型繫結正在使用中時,使用這個控制項做為資料來源的資料繫結控制項。Gets the data-bound control that is using this control as a data source when model binding is in use.

View

取得這個資料來源控制項的預設 (與僅供) 檢視物件。Gets the default (and only) view object for this data source control.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
IsTrackingViewState()

傳回值,這個值表示控制項是否正在追蹤檢視狀態。Returns a value that indicates whether the control is tracking view state.

LoadViewState(Object)

載入先前儲存的檢視狀態。Loads the previously saved view state.

MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
SaveViewState()

儲存控制項的狀態。Saves the state of the control.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
TrackViewState()

追蹤控制項的檢視狀態變更,讓這些變更能夠儲存在 StateBag 物件中。Tracks view-state changes to the control so that they can be stored in the StateBag object.

UpdateProperties(String, String)

更新單向資料繫結的必要屬性。Updates the required properties for one-way data binding.

UpdateProperties(String, String, String, String, String, String)

更新雙向資料繫結的必要屬性。Updates the required properties for two-way data binding.

事件

CallingDataMethods

模型繫結正在使用中而且呼叫資料方法時發生。Occurs when model binding is in use and data methods are being called.

明確介面實作

IDataSource.DataSourceChanged

當基礎資料來源已變更時發生。Occurs when the underlying data source has changed. 這項變更的起因可能是控制項屬性中的變更,或是資料中因資料來源控制項執行的編輯動作而發生的變更。The change may be due to a change in the control's properties, or a change in the data due to an edit action performed by the data source control.

IDataSource.GetView(String)

傳回檢視。Returns the view.

IDataSource.GetViewNames()

取得檢視名稱。Gets the view names.

IStateManager.IsTrackingViewState

傳回值,這個值表示控制項是否正在追蹤檢視狀態。Returns a value that indicates whether the control is tracking view state.

IStateManager.LoadViewState(Object)

載入先前儲存的檢視狀態。Loads the previously saved view state.

IStateManager.SaveViewState()

儲存控制項的狀態。Saves the state of the control.

IStateManager.TrackViewState()

追蹤控制項的檢視狀態變更,讓這些變更能夠儲存在 StateBag 物件中。Tracks view-state changes to the control so that they can be stored in the StateBag object.

擴充方法

GetDefaultValues(IDataSource)

取得所指定資料來源的預設值集合。Gets the collection of the default values for the specified data source.

GetMetaTable(IDataSource)

取得所指定資料來源物件中的資料表中繼資料。Gets the metadata for a table in the specified data source object.

TryGetMetaTable(IDataSource, MetaTable)

判斷資料表中繼資料是否可供使用。Determines whether table metadata is available.

適用於