<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
if (PeterBlum.DES.Globals.WebFormDirector.IsValid)
{
}
}
</script>
Leave the textbox blank and click Submit. Then mark the checkbox and again click Submit. The page will submit only if the checkbox is
unmarked. <br/><br/>
<asp:CheckBox ID="CheckBox1" runat="server" Text="When marked the RequiredTextValidator is enabled." /><br/><br/>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<des:RequiredTextValidator ID="RequiredTextValidator1" runat="server" ControlIDToEvaluate="TextBox1"
ErrorMessage="Required">
<EnablerContainer>
<des:CheckStateCondition ControlIDToEvaluate="CheckBox1" EvaluateOnClickOrChange="False" />
</EnablerContainer>
</des:RequiredTextValidator>
<br/>
<des:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_Click" />