Solved

refresh of aspx page

Posted on 2014-12-22
3
69 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
  • 2
3 Comments
 
LVL 7

Expert Comment

by:Gauthier
Comment Utility
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
Comment Utility
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 500 total points
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Read about why website design really matters in today's demanding market.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now