I have looked at the following forum post: http://www.telerik.com/forums/strange-behavior-when-using-args-set-cancel-true and although my code is similar still having odd behavior.
When clicking on the radButton it will fire the validation but it takes clicking on the "OK" button twice before the validation summary disappears.
Suggestions?
When clicking on the radButton it will fire the validation but it takes clicking on the "OK" button twice before the validation summary disappears.
Suggestions?
<telerik:RadCodeBlock runat="server"> <script type="text/javascript"> function ShowConfirm(clickedButton, args) { var validated = Page_ClientValidate('Form'); if (validated) { args.set_cancel(true); function callBackFunction(arg) { if (arg == true) { clickedButton.click(); } } //Open the window $find("<%=confirmWindow.ClientID %>").show(); //Focus the Yes button $find("<%=btnYes.ClientID %>").focus(); //Cancel the postback args.set_cancel(true); } } function YesOrNoClicked(sender, args) { var oWnd = $find("<%=confirmWindow.ClientID %>"); oWnd.close(); if (sender.get_text() == "Yes") { $find("<%=_btnFinish.ClientID %>").click(); } } </script></telerik:RadCodeBlock> <asp:Panel runat="server" ID="ShowHistorical" Visible="false"> <tr> <td style="text-align: center;" align="center">There is no <strong>Historical data for <asp:Label ID="_Step2CUName" runat="server"></asp:Label>.</strong> Please select this credit unions Member Type before proceeding.<br /> <br /> <telerik:RadDropDownList ID="_ddMember" runat="server" AutoPostBack="true" DefaultMessage="Select Member Type"></telerik:RadDropDownList> <asp:RequiredFieldValidator ID="_reqValMemberType" runat="server" ControlToValidate="_ddMember" Text="*" ForeColor="Red" ErrorMessage="You must select a Member Type before you can submit this Credit Union to be reinstated!<br />" ValidationGroup="Form" Display="Dynamic" EnableClientScript="true"></asp:RequiredFieldValidator> </td> </tr> </asp:Panel> <tr> <td align="center"> <telerik:RadButton ID="_btnFinish" runat="server" Text="Finish" CommandName="Continue" ValidationGroup="Form" Visible="false" OnClientClicking="ShowConfirm"></telerik:RadButton> <asp:ValidationSummary ID="ValidationSummary2" runat="server" ValidationGroup="Form" ShowMessageBox="true" ShowSummary="false" DisplayMode="BulletList" /> </td> </tr></table><telerik:RadWindowManager ID="windowManager1" runat="server"></telerik:RadWindowManager><telerik:RadWindow ID="confirmWindow" runat="server" VisibleTitlebar="false" VisibleStatusbar="false" Modal="true" Behaviors="None" Height="200px" Width="350px"> <ContentTemplate> <div style="margin-top: 30px; float: left;"> <div style="width: 60px; padding-left: 15px; float: left;"> <img src="/images/ModalDialogAlert.gif" alt="Confirm Page" /> </div> <div style="width: 230px; float: left;"> <asp:Label ID="lblConfirm" Font-Size="14px" Text="" runat="server"></asp:Label> <br /> <br /> <telerik:RadButton ID="btnYes" runat="server" Text="Yes" AutoPostBack="false" OnClientClicked="YesOrNoClicked"> <Icon PrimaryIconCssClass="rbOk"></Icon> </telerik:RadButton> <telerik:RadButton ID="btnNo" runat="server" Text="No" AutoPostBack="false" OnClientClicked="YesOrNoClicked"> <Icon PrimaryIconCssClass="rbCancel"></Icon> </telerik:RadButton> </div> </div> </ContentTemplate></telerik:RadWindow>