Solved

Auto reload asp page

Posted on 2004-08-20
2
364 Views
Last Modified: 2008-02-01
Hi experts,

This is going to sound like an odd question, but please bear with me

I have an asp page that for various convoluted, and difficult to change reasons only loads a variable half way down it, (in include files that can only be used once on the page for javascript reasons and are used elsewhere).

Very occasionally I'd like to use that variable at the top of the page.

Currently if i hit f5 and reload the page i the variable is written to a cookie and then loads in fine.

SO... what i'd really like to do is say at the bottom of the page - if condition is x then reload this entire page once automatically once.

Is that possible?
0
Comment
Question by:pjordanna
2 Comments
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 300 total points
ID: 11850760
You could do:

<%
if someCondition then
   response.write("<script>location.replace(""thispage.asp"")</script>")
end if
%>

OR:

<%
if someCondition then
   response.redirect("thispage.asp")
end if
%>

OR:
<%
if someCondition then
  Server.Transfer("thispage.asp")
end if
%>
0
 
LVL 31

Assisted Solution

by:alorentz
alorentz earned 200 total points
ID: 11850762
Sure:

if session("loaded") <> 1 then
   response.redirect "thepagename.asp"
   session("loaded") = 1
end if

That will reload the page when you go to it, once per session.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now