用HTML META标签和ASP来作定时迟时信息

Using ASP and HTML Meta TAGS To Make A Dynamic Delay Message

This is a little trick to display a timed message to the user after doing some sort of task. By mixing
some creative ASP with a simple HTML META Refresh you can display a message to a user for a specified
period of time and then redirect them back to wherever you want.

META tags with an HTTP-EQUIV attribute are equivalent to HTTP headers. Usually, they control the action of
browsers, and may be used to refine the information provided by the actual headers.

Here is how it works.

After completing some sort of ASP code. ( Possibly a database update ).

You can redirect the user like so to the delay page.

First, turn on buffering because you'll probably need it depending on where in your page you redirect.

Put this at the top of your page before the <HTML> Tag.
<% Response.Buffer = True %>

Then when you are ready to send the user to the delay page do something like this.

<% MYMESSAGE = Server.URLEncode("Adding New Product....Please Wait") %>
<% Response.Redirect ("delay.asp?DELAY_TIME=3&DELAY_MESSAGE=" & MYMESSAGE & "&REDIRECT_URL=default.asp") %>
As you see can see there are 3 variables we send to the delay page.

DELAY_TIME
REDIRECT_URL
DELAY_MESSAGE

Then the delay.asp page would consist of the following code.

<%@ LANGUAGE="VBSCRIPT" %>
<%
DELAY_TIME = Request("DELAY_TIME")
REDIRECT_URL = Request("REDIRECT_URL")
DELAY_MESSAGE = Request("DELAY_MESSAGE")
%>
<html>

<head>
<meta http-equiv="Refresh" content="<% =DELAY_TIME %>; URL=<% =REDIRECT_URL %>">
<title>Delay</title>
</head>

<body color="#FFFFFF">

<font face="Arial"><p align = "center"><strong><% =DELAY_MESSAGE %></strong></p></font>

</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值