Please visit our sponsor
UNKNOWN '************************************** ' 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 ' ' ' Inputs:None ' ' Returns:None ' 'Assumes:Required IE5 or more ' 'Side Effects:None 'This code is copyrighted and has limite ' d warranties. 'Please see http://www.Planet-Source-Cod ' e.com/xq/ASP/txtCodeId.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 &lt;%@ Language=VBScript %&gt; &lt;%Response.Expires=0%&gt; <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="save" content="history"> <style> .saveHistory {behavior:url(http://www.exhedra.com/vb/scripts/ShowCodeAsText.asp?txtCodeId=6799&lngWId=4#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> &lt;% Response.Write("<script>") Response.Write("var PersistedValue = '" & Now() & "';") Response.Write("</script>") %&gt; </head> <body onload="f1()"> <input class="saveHistory" onsave="fnSaveInput()" onload="fnLoadInput()" type="text" id="oPersistInput"> </body> &lt;% Response.Write(Now()) %&gt; </html>