Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

refresh of aspx page

Posted on 2014-12-22
3
Medium Priority
?
102 Views
Last Modified: 2015-03-11
I have a web aspx page that has a button that once it is clicked, it updates a table and response.redirects to a pdf file.

When I click on the back arrow of the in the pdf, the field that is supposed to be displayed is not displayed until I manually hit the F5 key.

In another words, the 'Complete' label is not visible when you go into the page, but needs to be visible when I return from the pdf.
0
Comment
Question by:sjs091654
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Expert Comment

by:Gauthier
ID: 40513376
That behavior is browser dependent, but the back button on recent browser use the cached rendering and doesn't refresh or execute code.
To prevent that just add an onunload event
0
 

Author Comment

by:sjs091654
ID: 40514771
How do I do that?   I also noticed that the 'Complete' label will appear if I don't redirect to another page on clicking the button
0
 
LVL 7

Accepted Solution

by:
Gauthier earned 2000 total points
ID: 40515756
https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers.onunload
Just add an empty anonymous function as the listener.
The mere presence of the event listener is enough to disable the caching when using back.

window.onunload = function (){};
or
window.addEventListener ("unload", function (){});
or
$( window ).unload(function() {};
0

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question