if the text is left empty and both checkboxes are clicked, and the submit button is clicked, the validation summary dispalys the error message twice. Why does it do that??
here is my markup. I have simplified it to the very bare minimum:
<form id="Form1" method="post" runat="server" style="margin-left: 0px; margin-top: 0px">
<asp:ScriptManager ID="scriptManager1" runat="server"></asp:ScriptManager>
<telerik:RadAjaxManager ID="ajaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="chkMain">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="panelMain" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="chkSub">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="panelSub" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" />
<asp:CheckBox ID="chkMain" runat="server" Checked="false" Text="main" AutoPostBack="true" OnCheckedChanged="chkMain_CheckedChanged" />
<asp:Panel ID="panelMain" runat="server" Visible="false">
<asp:TextBox ID="MainText" runat="server" />
<asp:RequiredFieldValidator ID="rv1" runat="server" ControlToValidate="MainText" ErrorMessage="required" />
</asp:Panel>
<asp:CheckBox ID="chkSub" runat="server" AutoPostBack="true" Checked="false" Text="sub" />
<asp:Panel ID="panelSub" runat="server" Visible="false">
Description
</asp:Panel>
<asp:Button ID="btnSubmit" CausesValidation="true" runat="server" Text="Submit"></asp:Button>
</form>
and my codebehind is very simple too:
protected void Page_Load(object sender, EventArgs e)
{
}
protected void chkMain_CheckedChanged(object sender, EventArgs e)
{
panelMain.Visible = chkMain.Checked;
}