Link to home
Start Free TrialLog in
Avatar of Webboy2008
Webboy2008

asked on

asp 3.0 refresh

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
Avatar of aibusinesssolutions
aibusinesssolutions
Flag of United States of America image

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

Avatar of Webboy2008
Webboy2008

ASKER

Try both, it does not seem working.
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.
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
ASKER CERTIFIED SOLUTION
Avatar of Loganathan Natarajan
Loganathan Natarajan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial