Modalpopupextender closing while click on "OK" button
I'm using a Modalpopupextender
ajax control to popup a panel. In the panel have two buttons,
one is Asp button (btnOk) and one is normal html button (btnCancel). While click on the OK
the popup panel closing, but I don't want to close the popup panel while click on the Ok
button, popup should close only while click on the cancel
button. How I can stop the Ok
button to close the popup panel. please find the code snippet below
<ATK:ModalPopupExtender
BackgroundCssClass="ModalPopupBG"
DropShadow="true"
OkControlID="btnOkay"
CancelControlID="btnCancel"
runat="server"
PopupControlID="AddTopic"
id="ModalPopupExtender1"
OnOkScript="onOk()"
TargetControlID="btnAddNew"/>
<asp:Panel ID="AddTopic" runat="server" CssClass="popup_Container" >
<div class="popup_Titlebar" id="PopupHeader">
<div class="TitlebarLeft">
Add New Topic
</div>
<div class="TitlebarRight" onclick="cancel();">
</div>
</div>
<div class="popup_Body">
<asp:Label ID="lblTopic" runat="server" Text="Topic Name"> </asp:Label>
<asp:TextBox ID="tbTopicName" runat="server" Width="400px" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="*" ControlToValidate="tbTopicName">
</asp:RequiredFieldValidator>
<br /> <br />
<span style="padding-left:350px">
<asp:Button ID="btnDone" runat="server" Text="Done" onclick="btnDone_Click"
UseSubmitBehavior="False"/>
<input id="btnCancel" value="Cancel" type="button" OnClick="cancel();"/>
</span>
</div>
<div class="popup_Buttons" s开发者_如何学Gotyle="display: none">
<input id="btnOkay" value="Done" type="button" />
</div>
</asp:Panel>
Add to the end of btnDone_Click method following instruction: ModalPopupExtender1.Show();
Remove the property "OkControlID" from the ModalPopupExtender.
精彩评论