如何设置模式弹出窗口的时间? [英] How do I time a modal pop up?

查看:251
本文介绍了如何设置模式弹出窗口的时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个功能,可以在asp.net中进行一些数据库更新.我希望模态弹出窗口在调用函数后仅显示5秒钟的成功"消息.在这种情况下,模式弹出窗口不会由任何"TargetControl"触发,而是会在功能完成后仅显示5秒钟.

I have a function that does some database update in asp.net. I'd like a modal popup to show a "success" message for just 5 seconds after my function has been called. In this case, the modal popup would not be triggered by any "TargetControl" but would show up for just 5 seconds once the function is done.

谢谢

推荐答案

您必须手动在面板上调用show方法,例如:

You have to manually call the show method on the panel like:

var pnl = $find("<%= modal.ClientID");
pnl.show();

因此您可以使用window.setTimeout来调用它:

So you can use window.setTimeout to call this:

window.setTimeout(function() { /* code */ }, 5000);

但是它不能很容易地发生.

HTH.

这篇关于如何设置模式弹出窗口的时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆