u can try make the modalpopup like the exemple below and dont associate an cancel or an ok button to modal then u can use the server side events and do wathever u want i just dunno why when i use the cancel button propertie this mess with my other buttons on my page >.<
and to open and close the modal use MyModalExtender.Show(); and MyModalExtender.Hide();
<asp:Panel ID="Popup" runat="server" CssClass="modalPopup" Style="display: none">
<asp:Label ID="lblResult" runat="server" Text="Original Content" /><br />
<asp:ImageButton runat="server" ImageUrl="~/layout/botoes/ok.gif" ID="OK" OnClick="OK_Click" CausesValidation="false" />
</asp:Panel>
<asp:Button ID="Target" runat="server" Style="display: none" />
<ajaxToolkit:ModalPopupExtender ID="MyModalExtender" runat="server" TargetControlID="Target"
PopupControlID="Popup" BackgroundCssClass="modalBackground" DropShadow="true" />