FormView.EnsureDataBound 方法

定义

请确保 FormView 控件在适当时绑定到数据。Makes certain that the FormView control is bound to data when appropriate.

protected:
 override void EnsureDataBound();
protected override void EnsureDataBound ();
override this.EnsureDataBound : unit -> unit
Protected Overrides Sub EnsureDataBound ()

注解

EnsureDataBound方法是类使用的帮助器方法, FormView 以确保 FormView 控件在适当时绑定到数据。The EnsureDataBound method is a helper method used by the FormView class to make certain that the FormView control is bound to data when appropriate. EnsureDataBound方法通常在方法中调用 OnPreRender ,以便在数据绑定控件尚未绑定但需要数据绑定时将控件绑定到数据源。The EnsureDataBound method is usually called during the OnPreRender method to bind the control to the data source when the data-bound control is not yet bound, but requires data binding. 此版本的方法已重写,以防止在 FormView 控件处于插入模式时发生数据绑定。This version of the method has been overridden to prevent data binding from occurring when the FormView control is in insert mode.

适用于

另请参阅