<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
if (PeterBlum.DES.Globals.WebFormDirector.IsValid)
{
}
}
</script>
Leave the textboxes blank and click Submit to see 3 errors in ValidationSummary controls below<br/><br/>
First Name: <des:TextBox ID="TextBox1" runat="server" />
<des:RequiredTextValidator ID="RequiredTextValidator1" runat="server" ControlIDToEvaluate="TextBox1"
ErrorMessage="Required (using Group1)" SummaryErrorMessage="First Name is required" Group="Group1">
<ErrorFormatterContainer>
<des:TextErrorFormatter Display="Dynamic" />
</ErrorFormatterContainer>
</des:RequiredTextValidator>
<des:CharacterValidator ID="CharacterValidator1" runat="server" ControlIDToEvaluate="TextBox1"
ErrorMessage="Only letters and space (using Group1)" SummaryErrorMessage="First Name has illegal characters"
LettersLowercase="true" LettersUppercase="true" Space="true"
Group="Group1">
<ErrorFormatterContainer>
<des:TextErrorFormatter Display="Dynamic" />
</ErrorFormatterContainer>
</des:CharacterValidator>
<br/>
Last Name: <des:TextBox ID="TextBox2" runat="server" />
<des:RequiredTextValidator ID="Requiredtextvalidator2" runat="server" ControlIDToEvaluate="TextBox2"
ErrorMessage="Required (using Group2)" SummaryErrorMessage="Last Name is required" Group="Group2">
<ErrorFormatterContainer>
<des:TextErrorFormatter Display="Dynamic" />
</ErrorFormatterContainer>
</des:RequiredTextValidator>
<des:CharacterValidator ID="CharacterValidator2" runat="server" ControlIDToEvaluate="TextBox2"
ErrorMessage="Only letters and space (using Group2)" SummaryErrorMessage="Last Name has illegal characters"
LettersLowercase="true" LettersUppercase="true" Space="true"
Group="Group2">
<ErrorFormatterContainer>
<des:TextErrorFormatter Display="Dynamic" />
</ErrorFormatterContainer>
</des:CharacterValidator>
<br/>
Postal Code:<des:TextBox ID="TextBox3" runat="server" />
<des:RequiredTextValidator ID="Requiredtextvalidator3" runat="server" ControlIDToEvaluate="TextBox3"
ErrorMessage="Required (using Group1 and Group2)" SummaryErrorMessage="Postal Code is required"
Group="Group1|Group2">
<ErrorFormatterContainer>
<des:TextErrorFormatter Display="Dynamic" />
</ErrorFormatterContainer>
</des:RequiredTextValidator>
<des:CharacterValidator ID="CharacterValidator3" runat="server" ControlIDToEvaluate="TextBox3"
ErrorMessage="Only digits and dash (using Group1 and Group2)" SummaryErrorMessage="Postal code has illegal characters"
Digits="true" OtherCharacters="-"
Group="Group1|Group2">
<ErrorFormatterContainer>
<des:TextErrorFormatter Display="Dynamic" />
</ErrorFormatterContainer>
</des:CharacterValidator>
<br/>
<des:Button ID="Button1" runat="server" Text="Submit - Group 1" OnClick="Button1_Click" Group="Group1"></des:Button>
<des:Button ID="Button2" runat="server" Text="Submit - Group 2" OnClick="Button1_Click" Group="Group2"></des:Button>
<input type="reset" id="Reset" runat="server" value="Reset" />
<hr/>
<br/>
<h2>Groups</h2>
Two ValidationSummary controls, each using a different validation group.<br/>
<des:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="Fix these errors in Group 1"
Group="Group1" /><br/>
<des:ValidationSummary ID="ValidationSummary2" runat="server" HeaderText="Fix these errors in Group 2"
Group="Group2" /><br/>
<h2>AutoUpdate</h2>
Fill in textboxes after first submitting with them empty. This ValidationSummary control will clear errors as you fix them.<br/><br/>
<des:ValidationSummary ID="ValidationSummary3" runat="server" HeaderText="Fix these errors"
Group="*"
AutoUpdate="true" /><br/>
<br/>
<h2>AutoUpdate and AutoUpdateFirstShows</h2>
Click Reset to remove all text. This will show up without submitting, once there are two or more textboxes with errors.
All expect only letters. So enter digits to get errors.<br/><br/>
<des:ValidationSummary ID="ValidationSummary4" runat="server" HeaderText="Fix these errors"
Group="Group1|Group2"
AutoUpdate="true" AutoUpdateFirstShows="TwoErrors" /><br/>