简体   繁体   English

asp.net/C#中的ModalPopup问题

[英]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. 我在我的Web应用程序中使用了modalpopup控件,当我单击“确定”按钮打开它后,我已经调用WCF函数来处理某些功能要求。

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 当前的行为,例如,当我单击OK按钮时,ModalPopup会保持打开状态,直到我的WCF操作完成为止;当它完成时,它将被关闭,因为我写下了逻辑来隐藏文件和后面的代码

  <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:Panel>

<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. 现在我需要的是我需要先关闭modalpopup,然后异步关闭它,这应该使WCF调用我找不到任何方法可以这样做,如果这个问题有意义,请有人帮助我。

Thanks in Advance 提前致谢

I believe you can hide ModalPopupExtender on the client side right after clicking the “Create” button: 我相信您可以在单击“创建”按钮后立即在客户端隐藏ModalPopupExtender:

<asp:Button ... OnClientClick="return ValidateSeconds();" /> 

function ValidateSeconds() {
    //your code
    $find('MPE').hide();
    //your code
}

See Also: 也可以看看:

How to Show / Hide a ModalPopupExtender using Javascript 如何使用Javascript显示/隐藏ModalPopupExtender

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM