Last post Nov 04, 2014 09:36 AM by smirnov
Nov 04, 2014 07:23 AM|nagarajasia|LINK
In my asp.net project, i have used a label in the Header Content of the Master Page.
The purpose of the label is to show the "Consolidated Total" amount of the products added in the cart.
After successfully adding the products into the Cart, if the user clicks the "browser back button" then the website displays the old value of "Consolidated Total".
My requirement is that, i need to
show only the latest Consolidated total value, even if the back button is clicked.
Can you any give me a clue, how to achieve my requirement?
Nov 04, 2014 07:35 AM|AidyF|LINK
You need to disable caching on the pages that have this control. If it is in the master page then you'll need to disable caching on your whole site. This is a very bad idea just to fix a back button issue that users are more than familiar with. Users
know that when they go "back" they get a cached page as that is how every other site on the internet works for them too. My advice is to not bother fixing this, but google for disabling caching in asp.net and you'll find lots of examples, but it will negatively
impact the performance of your server and the performance of the site on the client, all for nothing really.
Nov 04, 2014 07:47 AM|smirnov|LINK
Read http://support.microsoft.com/kb/234067 and either add suggested meta-tags in the header of aspx
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
or set them from the code behind
Response.Expires = -1;
Depends on browser you might need to play with some more tags e.g. read
Nov 04, 2014 09:22 AM|nagarajasia|LINK
Many thanks for your immediate response. I too considered that disabling cache would cause the serious performance problem in asp.net sites. Anyway i will look for any other better solution .
@smirnov Thanks for your reply. Do you have any other idea rather than disabling "Cache".
Nov 04, 2014 09:36 AM|smirnov|LINK
Do you have any other idea rather than disabling "Cache".
Doesn't it work?
I could imagine
value of total. The webservice will be called via js and returned value will be assigned to a div control.
idea, but anyway)
but the question is why to make it complicated? Currently it seems the problem is in that fact that page was cached and when you click on Back button you got it from cache.