Solved

Auto reload asp page

Posted on 2004-08-20
2
382 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

772 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