1

I have my custom css/html popup lightbox and a form with a button on it.

My goal is, when you press a button:

  1. open this popup
  2. then Thread.Sleep
  3. and after that Response.Redirect to another page.

Is this possible?

Here is my html code:

<a href="#test"><img src="images/smallimg.jpg"/></a>
<div class="overlay" id="test">
<img src="images/bigimg.jpg"/>
<a href="#page" class="close">x Close</a>
</div>
4

3 回答 3

0

由于您是在 JavaScript 中完成所有这些工作,因此调用服务器让主线程休眠 x 秒,然后在所有这些都可以在 JavaScript 中完成时重定向似乎很愚蠢。

显示该框,然后添加此 JavaScript 以创建延迟(在此示例中为 5 秒;它是 5000 毫秒)并重定向到另一个页面:

setTimeout(function() {
    location.href = 'OtherPage.aspx';
}, 5000);
于 2013-08-13T02:32:26.250 回答
0

如果您在 JavaScript 中执行此操作,请首先显示弹出窗口,然后使用 setTimeout(code,millisec,lang) 函数来激活 ButtonClick 事件/函数。

在 ASP.NET 中,通过后端绑定 setTimeout(code,millisec,lang) 函数。

于 2013-08-13T02:19:29.500 回答
0

你可以使用这个脚本

alert(YourMessage);
location.replace(YourPageName);

或者在你的情况下

$('.overlay').show(); // here you need to use proper style for your div to show as a popup
location.replace(YourPageName);

或者您也可以使用 jQuery 对话框。

如果您发现任何问题,请告诉我

于 2013-08-13T04:43:47.323 回答