Issue with ModalPopup in asp.net/C#
I have used modalpopup control in my web application and after open it when i click on ok button i have make call to WCF function to deal with some functional requirement.
Currently the behavior like , when i will click on OK button ModalPopup remained open until my WCF operation is completed and when it will completed it will be closed because i write down logic to hide in code behind file and my code as per below
<asp:Panel ID="PanelCheck" runat="server" CssClass="modalPopup" SkinID="Custom">
*Panel content here..*
<asp:Button ID="OkButton" runat="server" Text="Create" OnClientClick="return
ValidateSeconds();" OnClick="OkButton_Click" />
</asp:Pane开发者_开发技巧l>
<cc1:modalpopupextender id="MPE" runat="server" targetcontrolid="lnkTemp"
popupcontrolid="PanelCheck" backgroundcssclass="modalBackground" />
code behind
protected void OkButton_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
try
{
MPE.Hide();
*Logic to deal with WCF call..*
}
}
catch (Exception ex)
{
throw ex;
}
timerInstance.Enabled = true;
}
}
Now what i require is i need to close modalpopup first and then asynchronously it should make WCF call I could not find any ways to do that, please anyone help me if this question make any sense.
Thanks in Advance
I believe you can hide ModalPopupExtender on the client side right after clicking the “Create” button:
<asp:Button ... OnClientClick="return ValidateSeconds();" />
function ValidateSeconds() {
//your code
$find('MPE').hide();
//your code
}
See Also:
How to Show / Hide a ModalPopupExtender using Javascript
精彩评论