• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 307
  • Last Modified:

Losing controls when backing using the browser back button

I'm losing view of a few controls when I back using the browser back button,
I redisplayed it by using the refresh button.
How will I set to auto refresh so I don't need to refresh the page using the refresh button?
  • 2
  • 2
1 Solution
Michel PlungjanIT ExpertCommented:
You are likely not handling the back button correctly on the server if you have to refresh.

Have a quick look at this

and come back with a specific question or elaborate on the one you asked which is not completely clear
Its for refresh only. " location.reload(); "
May i know your scripting language.
Why don't you create back button for your website.That would help

<script type="text/JavaScript">
function AutoRefresh( t ) {
      setTimeout("location.reload(true);", t);
//   -->
<body onload="JavaScript:AutoRefresh(5000);">
<p>This page will refresh every 5 seconds.</p>
Michel PlungjanIT ExpertCommented:
@ insoftservice several issues with your code

1) do not call setTimeout with a string. The recommended method is
   setTimeout(function() { location.reload(true);}, t);
2) do not add event listeners inline and no need to prefix them with javascript: - instead do

window.onload=function() {
zachvaldezAuthor Commented:
This worked but I'm open to any suggestion or correction! I placed this is the Page_Load Event

     Response.Buffer = True
            Response.CacheControl = "no-cache"
            Response.AddHeader("Pragma", "no-cache")
            Response.Expires = -1441

and on the page header directive...
<meta http-equiv="refresh" content="600" />

Now if go to a page and click the browser back, I still have the controls. THIS WORKED ONLY FOR IE I believe.
zachvaldezAuthor Commented:
I provided the solution that worked.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now