Share via


BackLabel Property

Sets or returns a string from the validation summary that links to the form that contains an error. The default value is String.Empty.

public string BackLabel {
   get,
   set
}

Remarks

When an error occurs during the rendering of a form, the validation process uses the text in the BackLabel property as the string that is displayed on the validation summary page.

Example

The following example demonstrates how to use the BackLabel property to overwrite the default text of the link in ValidationSummary control to return to the form with the error.

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";
}   

See Also

Applies to: ValidationSummary Class