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.

适用于