<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
if (PeterBlum.DES.Globals.WebFormDirector.IsValid)
{
}
}
</script>
Notice the initial message shown in the RelatedControlDisplayMode="NoErrorsShown" example.<br/>
Click the Submit control to display the ValidationSummary controls.
Fix errors by entering text into the textboxes.<br/><br/>
<des:TextBox ID="TextBox1" runat="server" />
<des:RequiredTextValidator ID="RequiredTextValidator1" runat="server"
ControlIDToEvaluate="TextBox1" ErrorMessage="Required" />
<br/>
<des:TextBox ID="TextBox2" runat="server" />
<des:RequiredTextValidator ID="RequiredTextValidator2" runat="server"
ControlIDToEvaluate="TextBox2" ErrorMessage="Required" />
<br/>
<des:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Submit" /><br/>
<hr/>
<h2>RelatedControlDisplayMode="ErrorsShown" (the default)</h2>
<des:ValidationSummary ID="ValidationSummary1" runat="server" RelatedControlID="Label1"
RelatedControlDisplayMode="ErrorsShown" />
<asp:Label ID="Label1" runat="server" Text="Please fix the errors" ForeColor="Green"></asp:Label><br/>
<br/>
<h2>RelatedControlDisplayMode="AllErrorsFixed"</h2>
<des:ValidationSummary ID="ValidationSummary2" runat="server" RelatedControlID="Label2"
RelatedControlDisplayMode="AllErrorsFixed" />
<asp:Label ID="Label2" runat="server" Text="Thanks for fixing the errors" ForeColor="Maroon"></asp:Label><br/><br/>
<h2>RelatedControlDisplayMode="AllErrorsFixed" and AutoUpdate=True</h2>
Use AutoUpdate=True to make it a little more interactive as the errors are cleaned up.<br/>
<des:ValidationSummary ID="ValidationSummary3" runat="server" RelatedControlID="Label3"
RelatedControlDisplayMode="AllErrorsFixed" AutoUpdate="true" />
<asp:Label ID="Label3" runat="server" Text="Thanks for fixing the errors" ForeColor="Maroon"></asp:Label><br/><br/>
<h2>RelatedControlDisplayMode="NoErrorsShown"</h2>
<des:ValidationSummary ID="ValidationSummary4" runat="server" RelatedControlID="Label4"
RelatedControlDisplayMode="NoErrorsShown" />
<asp:Label ID="Label4" runat="server" Text="No errors to report" ForeColor="#C0C000"></asp:Label><br/>