AjaxControlToolkit icon indicating copy to clipboard operation
AjaxControlToolkit copied to clipboard

Throw if a referenced control (e.g. CancelControlID) cannot be found

Open MarceloBRAmaral opened this issue 5 years ago • 0 comments

The AJAX Control Toolkit <VERSION>

19.1

The installation method

  • [x ] Installer
  • [ ] NuGet package
  • [ ] A custom build from the source code

Minimal steps to reproduce the bug

  • create a modal popup
  • inside <ajaxToolkit:ModalPopupExtender use a CancelControlID="ButtonName" with a button that does not exists; in my case was Buttom2 where the proper button name had to be Button2 (I've put an "m" instead an "n")

Actual result

Popup doesn't appear when TargetControlID Button is pressed.

Expected result

Some error message like "CancelControlID name xxxxxxx not found". I've lost 3 hours to find this bug. It's my fault of course, but it can happen to anyone.

Browser(s) used

Only Chrome.

A site deployment method

  • [ ] VS development web-server,
  • [ ] IIS

note that the button name "Button2" is already fixed below:

<asp:Button ID="Button1" runat="server" CssClass="auto-style40" Text="TEST AJAX TOOLKIT" /> <asp:Panel ID="Panel7" runat="server" CssClass="auto-style46">
<asp:Label ID="Label1" runat="server" CssClass="auto-style41" Text="Button pressed is:"></asp:Label> <asp:TextBox ID="TextBox1" runat="server" CssClass="auto-style42"></asp:TextBox> </asp:Panel> <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <asp:Panel ID="PopUpPanel" runat="server" CssClass="modalPopup"> <asp:Label ID="Label2" runat="server" Text="HIDDEN TEXT"></asp:Label> <asp:Button ID="Button2" runat="server" CssClass="auto-style43" Text="Cancel" /> <asp:Button ID="Button3" runat="server" CssClass="auto-style44" Text="YES" /> <asp:Button ID="Button4" runat="server" CssClass="auto-style45" Text="NO" /> </asp:Panel>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" CancelControlID="Button2" PopupControlID="PopUpPanel" TargetControlID="Button1" BackgroundCssClass="modalBackground"> </ajaxToolkit:ModalPopupExtender>

MarceloBRAmaral avatar Sep 19 '19 16:09 MarceloBRAmaral