Solved

Auto reload asp page

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 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

22 Experts available now in Live!

Get 1:1 Help Now