简体   繁体   English

显示和隐藏模式弹出窗口扩展器不起作用

[英]Show and Hide Modal Popup Extender Not working

Hi all I have a modal popup extender set to a hidden linkbutton. 大家好,我将模式弹出扩展程序设置为隐藏的linkbutton。 So when I want to use it I am doing 所以当我想使用它时

protected void ProcessFileBtn_OnClick(object sender, EventArgs e)
{
    WaitModalPopupExtender.Show();
    //DO STUFF
    WaitModalPopupExtender.Hide();
}

Process takes a while, but no Modal Pop Up extender shows, when I create a button just to do the show function it works, but when I add in this 当我创建一个按钮只是为了执行显示功能时,过程需要一段时间,但不会显示Modal Pop Up扩展器,但是当我添加此按钮时

protected void Test_Click(object sender, EventArgs e)
{
    WaitModalPopupExtender.Show();
    System.Threading.Thread.Sleep(5000);
    WaitModalPopupExtender.Hide();

}

Nothing shows up. 什么都没有出现。 Any thoughts? 有什么想法吗?

It won't work. 它不会工作。 Why...?? 为什么...?? First request sent to Server. 第一个请求发送到服务器。

WaitModalPopupExtender.Show();----Executed---But no response send to Client
System.Threading.Thread.Sleep(5000);----Executed---But no response send to Client
WaitModalPopupExtender.Hide();----Executed---Now its time to send the response

Now you can expect the output that will be sent to the Client 现在您可以预期将输出到客户端的输出

Without seeing all of the code it's hard to tell, but I believe that the page is doing a PostBack when you click the linkbutton. 没有看到所有代码,这很难说,但是我相信当您单击链接按钮时,页面正在执行PostBack When the page does a postback, it refreshes and therefore your ModalPopupExtender won't show. 页面执行回发时,它将刷新,因此您的ModalPopupExtender将不会显示。 I think you're looking for and Ajax call to do what you want, which I'm pretty sure is showing a wait window while processing data. 我认为您正在寻找和Ajax调用来做您想要的事情,我敢肯定,在处理数据时会显示一个等待窗口。

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

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