Control.HasChildViewState, propriété
.NET Framework 2.0
Obtient une valeur indiquant si les contrôles enfants du contrôle serveur en cours possèdent des paramètres d'état d'affichage enregistrés.
Espace de noms : System.Web.UI
Assembly : System.Web (dans system.web.dll)
Assembly : System.Web (dans system.web.dll)
Vous pouvez éviter tout appel superflu à la méthode ClearChildViewState en utilisant cette propriété pour vérifier que des contrôles enfants du contrôle serveur stockent des informations d'état d'affichage.
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 void DataBind()
{
super.OnDataBinding(EventArgs.Empty);
// Reset the control's state.
get_Controls().Clear();
// Check for HasChildViewState to avoid unnecessary calls to
// ClearChildViewState.
if (get_HasChildViewState()) {
ClearChildViewState();
}
set_ChildControlsCreated(true);
if (!(get_IsTrackingViewState())) {
TrackViewState();
}
} //DataBind
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Édition Media Center, Windows XP Professionnel Édition x64, Windows XP SP2, Windows XP Starter Edition
Le .NET Framework ne prend pas en charge toutes les versions de chaque plate-forme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise.