We help IT Professionals succeed at work.

asp 3.0 refresh

Webboy2008
Webboy2008 asked
on
Medium Priority
306 Views
Last Modified: 2012-05-06
I have the following codes, and if it is not 7 then I want  to refresh one time. How can I do that in asp 3.0? Thank you
if CurrentStatusID="7" then 'good to go
   pass=1
else
  pass=0
  asp.refresh ?
end if
Comment
Watch Question

The simplest method would be to redirect the page back to itself.

if CurrentStatusID="7" then 'good to go
   pass=1
else
  pass=0
  Response.Redirect('.", False)
end if
Or if you want an actual browser refresh, you could do something like

if CurrentStatusID="7" then 'good to go
   pass=1
else
  pass=0
  Response.Write("<script>location.reload(true);</script>")
end if

Author

Commented:
Try both, it does not seem working.

Author

Commented:
Sorry: the <script> one is working ok now. But my second issue is
I don't want to refresh forever can I do  that?
if CurrentStatusID="7" then 'good to go
   pass=1
else
  pass=0
  Response.Write("<script>location.reload(true);</script>")
        if refresh process is more than 2 mins Or len(fresh) >= 5  
            response.redirect ("xxx.com")
        end if
end if
What exactly are you trying to do?  You might want to just include a meta refresh tag in your html if you just want the page to refresh every 10 seconds or so.  You could also set a session cookie with the current time, then check the value on each page load, if 2 minutes pass redirect to another page.

Author

Commented:
It is hard to describe. But is that possible to do what I just asked for?
if CurrentStatusID="7" then 'good to go
   pass=1
else
    pass=0
  If Session("scheck") Is Nothing Then Session("scheck") = Now()
  If Session("scheck") < Now.AddMinutes(-2) Then    
       Response.redirect ("xxx.com")
  End If
  Response.Write("<script>location.reload(true);</script>")
End if
LAMP Developer
CERTIFIED EXPERT
Commented:

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.