Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 7th, 2005, 02:55 PM
XXL XXL is offline
Authorized User
 
Join Date: Dec 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Append random numbers to link

I want to prevent a web page from being cached by generating a random number at the end of the link.
ex. mypage.asp?1429652
Can anyone help me with the code?

 
Old March 7th, 2005, 04:53 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<%
Randomize()
Dim upperlimit, lowerlimit
upperlimit = 50000
lowerlimit = 30000

Dim RndNumber
RndNumber = Int((upperlimit - lowerlimit + 1)*Rnd() + lowerlimit)

Response.Redirect "page.asp?rndnum=" & RndNumber
%>


 
Old March 7th, 2005, 06:10 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

This wil not prevent your page from being cached, what exactly are you trying to achieve?

Google 'response.cacheControl' and have a read

Wind is your friend
Matt
 
Old March 8th, 2005, 04:43 AM
XXL XXL is offline
Authorized User
 
Join Date: Dec 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm building a wap site (asp+wml). Besides the cache-control wich I'm going to use, I'm trying to prevent people going on their mobile browsers to the same download page over and over again. (hope it works)







Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating random numbers invisibleman18 Java Basics 2 March 26th, 2007 12:22 AM
Random Numbers Using MersenneTwister JoeDW C# 0 September 13th, 2006 11:10 AM
Random Numbers welshboy2005 C# 1 May 19th, 2005 06:01 AM
random numbers from/to database HammR PHP Databases 10 January 14th, 2005 12:08 PM
Random Numbers not so random... katsarosj ASP.NET 1.0 and 1.1 Basics 5 November 20th, 2003 12:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.