Repeater.RequiresDataBinding 属性

定义

获取或设置一个值,该值指示 Repeater 控件是否需要绑定到其指定数据源。Gets or sets a value indicating whether the Repeater 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 控件需要绑定到数据源,则为 Repeater;否则为 falsetrue if the Repeater control needs to bind to a data source; otherwise, false.

注解

Repeater 控件使用 RequiresDataBinding 属性来确定控件是否需要调用 DataBind 方法以绑定到其指定的数据源。The Repeater control uses the RequiresDataBinding property to determine whether the control needs to call the DataBind method to bind to its specified data source.

每次在调用了 OnInit 方法之后,在 DataSourceDataSourceIDDataMember 属性上调用 set 访问器来更改数据源后,ASP.NET 会将 RequiresDataBinding 属性的值设置为 trueEach time the set accessor is called on either the DataSource, DataSourceID, or DataMember property to change the data source after the OnInit method has already been called, ASP.NET sets the value of the RequiresDataBinding property to true. 调用 OnDataSourceViewChanged 方法时,RequiresDataBinding 属性的值也设置为 trueThe value of the RequiresDataBinding property is also set to true when the OnDataSourceViewChanged method is called.

ASP.NET 将 RequiresDataBinding 属性的值设置为在调用 DataBind 方法之后立即 falseASP.NET sets the value of the RequiresDataBinding property to false immediately after the DataBind method is called.

适用于

另请参阅