DataBoundControl.MarkAsDataBound 메서드

정의

뷰 상태의 컨트롤 상태를 데이터에 바인딩된 상태로 설정합니다.

protected:
 void MarkAsDataBound();
protected void MarkAsDataBound ();
member this.MarkAsDataBound : unit -> unit
Protected Sub MarkAsDataBound ()

예제

다음 코드 예제에서는 파생된 데이터 바인딩된 컨트롤 클래스에서 메서드를 사용 하는 방법을 MarkAsDataBound 보여 줍니다. 메서드에서 GetData 데이터를 검색하고 메서드 RequiresDataBinding 를 사용하여 컨트롤 PerformDataBinding 에 바인딩한 후 속성이 설정 false 되고 MarkAsDataBound 메서드가 호출되어 컨트롤이 바인딩을 완료했으며 현재 페이지의 수명 주기 동안 더 이상 필요하지 않음을 알립니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 DataBoundControl 클래스입니다.

protected override void PerformSelect() {            

   // Call OnDataBinding here if bound to a data source using the
   // DataSource property (instead of a DataSourceID), because the
   // databinding statement is evaluated before the call to GetData.       
    if (! IsBoundUsingDataSourceID) {
        OnDataBinding(EventArgs.Empty);
    }            
    
    // The GetData method retrieves the DataSourceView object from  
    // the IDataSource associated with the data-bound control.            
    GetData().Select(CreateDataSourceSelectArguments(), 
        OnDataSourceViewSelectCallback);
    
    // The PerformDataBinding method has completed.
    RequiresDataBinding = false;
    MarkAsDataBound();
    
    // Raise the DataBound event.
    OnDataBound(EventArgs.Empty);
}
Protected Overrides Sub PerformSelect()

    ' Call OnDataBinding here if bound to a data source using the 
    ' DataSource property (instead of a DataSourceID) because the 
    ' data-binding statement is evaluated before the call to GetData.
    If Not IsBoundUsingDataSourceID Then
        OnDataBinding(EventArgs.Empty)
    End If

    ' The GetData method retrieves the DataSourceView object from the 
    ' IDataSource associated with the data-bound control.            
    GetData().Select(CreateDataSourceSelectArguments(), _
        AddressOf OnDataSourceViewSelectCallback)

    ' The PerformDataBinding method has completed.
    RequiresDataBinding = False
    MarkAsDataBound()

    ' Raise the DataBound event.
        OnDataBound(EventArgs.Empty)

End Sub

설명

데이터 바인딩된 컨트롤의 뷰 상태 데이터에 현재 바인딩 되었는지 여부를 나타내는 값을 유지 관리 합니다. 합니다 MarkAsDataBound 값을 설정 하는 메서드 true합니다.

적용 대상

추가 정보