BackLabel Property

Imposta o restituisce una stringa del riepilogo di convalida che crea un collegamento al form contenente un errore. Il valore predefinito è String.Empty.

public string BackLabel {
   get,
   set
}

Osservazioni

Quando si verifica un errore durante il rendering di un form, il processo di convalida utilizza il testo contenuto nella proprietà BackLabel come stringa visualizzata nella pagina del riepilogo di convalida.

Esempio

Nell'esempio che segue viene illustrato come utilizzare la proprietà BackLabel per sovrascrivere il testo predefinito del collegamento nel controllo ValidationSummary affinché venga visualizzato il form contenente l'errore.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

   ' ErrorMessages appear in ValidationSummary control.
   RequiredFieldValidator1.ErrorMessage = "Username Was A must Field"
   RequiredFieldValidator2.ErrorMessage = "Password Was A must Field"
   ' Change the dafault text to link back to the
   ' ValidationSummary control.
   ValidationSummary1.BackLabel = "Back to Main Form"

End Sub

[C#]
void Page_Load(Object sender, EventArgs e)
{
   // ErrorMessages appear in ValidationSummary control.
   RequiredFieldValidator1.ErrorMessage = "Username Was A must Field";
   RequiredFieldValidator2.ErrorMessage = "Password Was A must Field";
   // Change the dafault text to link back to the
   // ValidationSummary control.
   ValidationSummary1.BackLabel="Back to Main Form";
}   

Vedere anche

Si applica a: classe ValidationSummary