Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Issue: ModalPopupExtender gets hidden from any button [27902]

$
0
0
Any button inside a ModalPopupExtender hides the modal. It doesn't matter if the button is set as CancelControlID or OkControlID.

In the following example, both btnFoo and btnBar closes the modal.

```
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="btnOpen" runat="server" Text="Open" />
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
CancelControlID="btnModalCancel" OkControlID="btnModalOkay" TargetControlID="btnOpen"
PopupControlID="Panel1">
</cc1:ModalPopupExtender>

<asp:Panel ID="Panel1" Style="display: none" runat="server">
<asp:Button ID="btnModalCancel" runat="server" Text="Cancel" />
<asp:Button ID="btnModalOkayl" runat="server" Text="OK" />
<asp:Button ID="btnFoo" runat="server" Text="Foo" />
<asp:Button ID="btnBar" runat="server" Text="Bar" />
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>



```
Comments: Hi Fadil, The `OnClientClick="return false;"` disables the server side click event. For example this button: ``` <asp:Button ID="btnFoo" runat="server" Text="Foo" OnClick="btnFoo_Click" OnClientClick="return false;" /> ``` `btnFoo_Click()` is never run in the code behind

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>