Home | Advertising Info7 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Saturday, May 04, 2024  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - Advanced
 PowerASP Code Help Area : Classic ASP - Advanced
Subject Info: Using ASP and HTML Meta TAGS To Make A Dy A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
cwilliams
Admin Group
Admin Group
Avatar

Joined: April/26/2004
Location: United States
Online Status: Offline
Info: 137
Added: April/27/2004 at 8:08pm | IP Logged Quote cwilliams

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>

Click here to try it out for yourself.

Why would you want  to do this ?.. That's up to you, it's just a cool little trick I've used a few times.



__________________


Chris Williams
http://www.PowerASP.com
Back to Top View cwilliams's Profile Search for other info by cwilliams
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2024 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com