Time time when using HTML Meta tags and ASP

zhaozj2021-02-16  192

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.

Meta tags with an apttp-equiv attribute area. 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 Completion 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 tag. <% Response.buffer = true%>

............

<% 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. 3 Variables we send to the delay page.

DELAY_TIMEREDIRECT_URLDELAY_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")%>

<% = delay_message%>

转载请注明原文地址:https://www.9cbs.com/read-8411.html

New Post(0)