Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make the page refresh? 2

Status
Not open for further replies.

jagilman

Programmer
Aug 30, 2000
168
0
0
US
After the user logs into my site I would like the code to perform the same step as if the user clicked the refresh button. This is being used to make additional menu choices available for different users. I have not found any VBScript code to cause this to happen.

Thanks John A. Gilman
gms@uslink.net
 
At the top of your page, type this.

Code:
<META HTTP-EQUIV=&quot;REFRESH&quot; Content=&quot;60&quot;>

This will automatically refresh the page every 60 (See content) seconds.
 
put this on every asp page (possibly in an include file)

<%
'FORCE NO CACHE ON EVERY LOAD OF EVERY PAGE

Response.Expires = 15
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader &quot;pragma&quot;,&quot;no-cache&quot;
Response.AddHeader &quot;cache-control&quot;,&quot;private&quot;
Response.CacheControl = &quot;no-cache&quot;
%>

Cheers to vasah20 (leo) for that. Works great.

:)
Paul Prewett
penny.gif
penny.gif
 
I do this:
Code:
<%
Response.Expires = -1000
%>

This makes the page expire before it loads, so it will never cache
 
Ok guys! Here is the problem again!
I failed to fully explain the problem.
If the user who logs in is a manager I set a session variable (manager) = True
If I click the refresh button, my menu choices change and the management button will show up. I am using frames and the extra button is on the menu frame.
The refresh examples you posted don't seem to help.

My code in my login form looks like this.

If manager Then
then refresh the window
Here is where the command needs to be
Else
send the user to another page
End If John A. Gilman
gms@uslink.net
 
if you need to wipe your session variables, then do a session.abandon

or set each variable = &quot;&quot;

session(&quot;manager&quot;) = &quot;&quot;

penny.gif
penny.gif
 
If the user is a manager, the session variable is set to True and then when I hit the refresh button my page reloads and because the variable is True the manager menu choice is now visible.

All I need is some way for my code to refresh the browser right in the middle of the &quot;If Block&quot; the same as if the user had clicked the refresh button.

Thanks John A. Gilman
gms@uslink.net
 
howabout a response.redirect() ??

if whatever
response.redirect(&quot;theSamePage.asp&quot;)
else
somethingElse
end if

that would simply reload the page...

penny.gif
penny.gif
 
OK. To refresh only i frame, i put a refresh button on that page (or another, but then you have to target it). Then, with some clientside scripting (sorry, but I use vbscript) I do this:

(in the button's onclick event)
Code:
window.history.go(0)

this refreshes ONLY the page that the button is on. _________________
Bixarrio

e = m * (c ^ 2)
 
OH. You could put this in the middle of an if block too.
link9 is also good.

but there's no way scripting will continue where it left off.

Unless, of course, the button was already there, but it was set to invisible. now it is set to visible. but that would defeat the purpose of the whole session variable thing _________________
Bixarrio

e = m * (c ^ 2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top