Control.HasChildViewState Propiedad

Definición

Obtiene un valor que indica si los controles secundarios del control de servidor actual tienen cualquier configuración de estado de vista guardada.

protected:
 property bool HasChildViewState { bool get(); };
protected bool HasChildViewState { get; }
member this.HasChildViewState : bool
Protected ReadOnly Property HasChildViewState As Boolean

Valor de propiedad

true si los controles secundarios han guardado información de estado de vista; de lo contrario, false.

Ejemplos

public override void DataBind() 
{
   base.OnDataBinding(EventArgs.Empty);
   // Reset the control's state.
   Controls.Clear();
   // Check for HasChildViewState to avoid unnecessary calls to ClearChildViewState.
   if (HasChildViewState)
      ClearChildViewState();
   ChildControlsCreated = true;
   if (!IsTrackingViewState)
      TrackViewState();
}
Public Overrides Sub DataBind()
   MyBase.OnDataBinding(EventArgs.Empty)
   ' Reset the control's state.
   Controls.Clear()
   ' Check for HasChildViewState to avoid unnecessary calls to ClearChildViewState.
   If HasChildViewState Then
      ClearChildViewState()
   End If
   ChildControlsCreated = True
   If Not IsTrackingViewState Then
      TrackViewState()
   End If
End Sub

Comentarios

Puede evitar llamadas innecesarias al ClearChildViewState método mediante esta propiedad para comprobar que los controles secundarios del control de servidor almacenan información de estado de vista.

Se aplica a

Consulte también