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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing A Page Just Once

Status
Not open for further replies.

CandieCane

Programmer
Apr 9, 2002
25
US
Hi!
If anyone could give me an idea on how going about this, I'd be greatful. I have been trying to use the: <META HTTP-EQUIV=&quot;refresh&quot; CONTENT=&quot;0;&quot;>. This proves to be quite difficult using Frames.

Any help appreciated, Candie ;o)

&quot;Never forget what you learn & learn from what you forget!&quot;
 
If anyone is reading this, I'll be a little more specific...

I am using frames (top, left & main). My left frames is the navigational links, top is the logo & main in where the pages are displayed. In my left frame links, I have a admin logon link that prompts the user to enter a userid and password. He then clicks on the logon button that goes to an asp which checks our database to see if he exists. In this asp page, we define a Session variable set to &quot;yes&quot; if he exists. We then redirect to the frameset, and in the left frame I have an if statement. IF Session(&quot;admin&quot;) = &quot;yes&quot; then display the default links plus some extra and ELSE being just the default links. In order for this to show, I need to refresh that frame just once for them to be displayed

If anyone has any ideas or knows how to do this, please write back!

Thanks!!! Candie ;o)

&quot;Never forget what you learn & learn from what you forget!&quot;
 
Funny you should say that...

In your asp processing page, once you have validated the user, set a variable to true (make sure it is false if you haven't just validated!):

getrefresh=true

Then in your HTML body tag add this code:

Code:
<BODY <%If getrefresh then %>onLoad=&quot;javascript:parent.leftframename.location.href=&quot;yourpage.asp&quot;<% End if %>>

Which will conditionally load the left frame when this page has loaded. You could do this with a function or whatever, but this is more simple.



Derren
[Mediocre talent - spread really thin]
 
hey i have a similar question concerning this topic.

i have a bulletin board in my mainframe (left and top frames also exist). when i post a new message on the board and return to it, it doesnt update the new posts.

i basically have to hit the refresh on my browser to see the new post.

i added the <META HTTP-EQUIV=&quot;refresh&quot; CONTENT=&quot;0;&quot;> but it is a continuous loop of refreshing.

how would i have it autorefresh just once????

thank you in advance.
 
Derren,
Thanks for the tip. I figured this out for myself later after my posts. As for asking the same question in multiple forums, I'm not sure where everyone goes to look all the time so I took my chances and wrote it in every forum that it related too.

Hi Kavaman,
I seen that thread for that meta tag in another forum and tried it myself. It did the same for me! 1 way of going about refreshing a page just once is that way Derren said by using javascript all in one. Another would be writing a separate function using <script language=&quot;javascript&quot;> in the header to call a function in the onLoad() within the body. Such as:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;javascript&quot;>
function NavLoad()
{
parent.leftFrame.location='Frame3.asp'
}
</script>
</head>
<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot; onLoad=&quot;NavLoad();&quot;>
</body>
</html>

Hope that helps! If not, a couple of good websites are aspin.com & htmlgoodies.com. I'm sure there's more but their pretty good resources! If you still have probs, I'll try and help! ;o)

Candie ;o)

&quot;Never forget what you learn & learn from what you forget!&quot;
 
Here are the meta tags you need to ensure that the page does not cache and does not need refreshing:

Code:
<META http-EQUIV=&quot;expires&quot; CONTENT=&quot;0&quot;><META http-EQUIV=&quot;Pragma&quot; CONTENT=&quot;no-cache&quot;>
Derren
[Mediocre talent - spread really thin]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top