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 Glenn, We have tested this control in the scenario you provided. And yes, this is the problem of the ModalPopup extender. We will investigate this issue and fix it in the nearest future. Let me offer you a workaround for now. If you don't want the popup to close on a button click, just add the ```OnClientClick``` attribute with the JavaScript ```return false;``` statement to this button: ``` <asp:button runat="server".... OnClientClick="return false;" /> ``` Best regards, Fadil
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 Glenn, We have tested this control in the scenario you provided. And yes, this is the problem of the ModalPopup extender. We will investigate this issue and fix it in the nearest future. Let me offer you a workaround for now. If you don't want the popup to close on a button click, just add the ```OnClientClick``` attribute with the JavaScript ```return false;``` statement to this button: ``` <asp:button runat="server".... OnClientClick="return false;" /> ``` Best regards, Fadil