IE5,searched,high,code,which,will,allow,fresh
Quick Search for:  in language:    
IE5,searched,high,code,which,will,allow,fresh
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ASP/ VbScript Stats

 Code: 132,008 lines
 Jobs: 161 postings

 
Sponsored by:

 

You are in:

 
Login


 

 


Latest Code Ticker for ASP/ VbScript.
List Records
By Edito P. Aspra Jr. on 8/26


DSN Less Connection to SQL Server Database
By alpesh shah on 8/26


Click here to see a screenshot of this code!Database Driven Select Menu w/ default select
By Jayson Starkey on 8/26

(Screen Shot)

A Simple guestbook in ASP
By Matthew Meadows on 8/25


Simple GuestBook or Feedback Page Requiring No Database Implementation
By Ken Alabi on 8/25


if i remember, this is a M. Harris code sample
By ask on 8/24


MTS Registration Script
By Igor Krupitsky on 8/23


Click here to see a screenshot of this code!Creating Windows Users with ASP and ADSI
By jamespwalters on 8/23

(Screen Shot)

News Poster (Advanced)
By Martin Kilbryde on 8/22


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Get page from server when user presses the back or forward button

Print
Email
 
VB icon
Submitted on: 7/23/2001 4:21:42 PM
By: Vikas Kumar 
Level: Advanced
User Rating: By 8 Users
Compatibility:ASP (Active Server Pages), HTML, VbScript (browser/client side)

Users have accessed this code 5804 times.
 
 
     I searched high and low for a code which will allow me to get a fresh copy of my page even if the user presses the back or the ofrward button. Finally i gave up and wrote my own. Expires and no-cache do not cache the page but it will still go into the history and can be retreived by the back button without going to the server It needs IE5 or above to run
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

    '**************************************
    ' Name: Get page from server when user p
    '     resses the back or forward button
    ' Description:I searched high and low fo
    '     r a code which will allow me to get a fr
    '     esh copy of my page even if the user pre
    '     sses the back or the ofrward button. Fin
    '     ally i gave up and wrote my own.
    Expires and no-cache Do Not cache the page but it will still go into the history and can be retreived by the back button without going to the server
    It needs IE5 or above To run
    ' By: Vikas Kumar
    '
    ' Assumes:Required IE5 or more
    '
    'This code is copyrighted and has    ' limited warranties.Please see http://w
    '     ww.Planet-Source-Code.com/xq/ASP/txtCode
    '     Id.6799/lngWId.4/qx/vb/scripts/ShowCode.
    '     htm    'for details.    '**************************************
    
    cut the code below a save it as a asp.
    when you run this code after pressing the back/forard button you will see it will automatically refresh
    <%@ Language=VBScript %>
    <%Response.Expires=0%>
    <HTML>
    <HEAD>
    <META NAME="save" CONTENT="history">
    <STYLE>
    .saveHistory {behavior:url(#default#saveHistory);}
    </STYLE>
    <SCRIPT>
    var RandomValue;
    function fnSaveInput(){
    oPersistInput.setAttribute("sPersistValue",PersistedValue);
    }
    function fnLoadInput(){
    oPersistInput.value=oPersistInput.getAttribute("sPersistValue");
    RandomValue=oPersistInput.getAttribute("sPersistValue");
    }
    function f1()
    {
    if (RandomValue==PersistedValue)
    	{window.location.reload(true)
    	}
    }
    </SCRIPT>
    <%
    Response.Write("<SCRIPT>")
    Response.Write("var PersistedValue = '" & Now() & "';")
    Response.Write("</SCRIPT>")
    %>
    </HEAD>
    <BODY onload='f1()'>
    <INPUT class=saveHistory onsave="fnSaveInput()" onload="fnLoadInput()" type=text id=oPersistInput>
    </BODY>
    <%
    Response.Write(Now())
    %>
    </HTML>

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
7/27/2001 5:11:43 AM:Aquarius
GREATTTTTT CODE!!!! i badly needed this 
on my project i'm currently working 
on!!!
keep it up!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/28/2001 1:12:10 PM:Pranab
Great code
Really useful
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/30/2001 1:45:40 PM:Carlos
Works very well, thanks!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/13/2001 2:43:28 PM:vbuser1976
I had been spending days trying to 
accomplish this.  Thanks, it is great. 
But I noticed one little problem:  It 
needs a little adjustment when you use 
it on a frameset page.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/3/2002 11:24:51 AM:Ian Livesey
Does not work on my IE6, back and 
forward still work, please advise!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/3/2002 2:18:21 PM:aurora
i need this code for my frameset. i'm 
not a programmer. how will i do it.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/4/2002 11:15:04 AM:Ian Livesey
Retried cutting and pasting code from 
<%@ Language=VBScript %> to 
%>
</HTML>
Called it 
backforward.asp
still does not work, 
anybody any ideas. I'm running IE6 on 
XP Pro.
Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | ASP/ VbScript Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.