BaseDataList.RequiresDataBinding 属性
定义
获取或设置一个值,该值指示数据列表控件是否需要绑定到其指定的数据源。Gets or sets a value indicating whether the data listing control needs to bind to its specified data source.
protected:
property bool RequiresDataBinding { bool get(); void set(bool value); };
protected bool RequiresDataBinding { get; set; }
member this.RequiresDataBinding : bool with get, set
Protected Property RequiresDataBinding As Boolean
属性值
如果该控件需要绑定到数据源,则为 true;否则为 false。true if the control needs to bind to a data source; otherwise, false.
注解
BaseDataList控件使用 RequiresDataBinding 属性来确定控件是否需要调用 DataBind 方法以绑定到其指定的数据源。The BaseDataList control uses the RequiresDataBinding property to determine whether the control needs to call the DataBind method to bind to its specified data source.
每次在 set DataSource 调用方法后,在、或属性上调用访问器 DataSourceID DataMember 来更改数据源后 OnInit ,ASP.NET 会自动将属性的值设置 RequiresDataBinding 为 true 。Each time the set accessor is called on either the DataSource, the DataSourceID, or the DataMember property to change the data source after the OnInit method has already been called, ASP.NET automatically sets the value of the RequiresDataBinding property to true. RequiresDataBinding调用方法时,也将属性的值设置为 true OnDataSourceChanged 。The value of the RequiresDataBinding property is also set to true when the OnDataSourceChanged method is called.
RequiresDataBinding false 调用方法后,ASP.NET 会自动将属性的值设置为 DataBind 。ASP.NET automatically sets the value of the RequiresDataBinding property to false immediately after the DataBind method has been called.