Last post Nov 20, 2009 09:22 PM by ajay.ms2000
Nov 19, 2009 01:14 AM|bapanpally|LINK
plzz help me its very urgent,
to disable the cache from client and on server side i added these lines of code, and it works fine in every broswer.
my main concern is, i have a address page(when ever i visit this page it loads the page with info that is there in the database) it has a dropdown for states and textbox for zipcode, when a user enters a wrong zipcode for that state it does the server side
validation and displays a serverside error message that "you entered a wrong zipcode", after this if i enter the correct zipcode click save button it saves successfully and takes me to next page, (i can see the new data in the database table)
my problem comes here,
scenario1:(first time page loads and if i enter correct zipcode(i mean here im not entering the wrong zipcode) and click on save button) it takes me to another page, if i click on browser back it displays with the new data what is there
in the database i mean page loads(it goes through pageload event and populates all the fields)
if i enter wrong zipcode it gives serverside error message, after
i correct it and enter the correct zipcode and click on save button it takes me to the next page,
when i hit the browser back button instead of loading the page with the data in the database it says "webpage is expired". if i do the refresh then it reloads the page with new data.
plzzzz help me guys, i need to fix it in production...... i'm not a guru in asp.net, still i'm in learning process .....
onemorething i tried every HTTP headers
'Dim kj As String = "private, no-cache, must-revalidate"
i hope gud people out there helps me
plzzz reply if u have a clear answer and how to do it, remember it should wrk in all browsers
Browser Back Button
webb page expired
Nov 19, 2009 11:27 AM|losssoc|LINK
When you hit the back button, you get the "webpage is expired" because cache is turned off for the page.
You can use Response.Expires to set the cache expiration time in minutes. That way, when a user hits the back button within the specified time the page will load.
Example: Response.Expires=5 Page cache will expire in five minutes.
You can Use Page Output caching by adding an <%@ OutputCache="15" VaryByParam="none" %> directive to a page. The above example caches its contents for 15 seconds. The VaryByParam attribute causes a new instance of a page to be cached when a different parameter
is passed to the page. Example VaryByParam="id". When different id is passed it caches that page.
If you want to manipulate the Page Output Cache Programmatically you can add following to page load event:
For the above, the page is cached on the browser, proxy servers, and web server for 15 seconds.
Nov 19, 2009 05:29 PM|bapanpally|LINK
thanks for the quick response,
i tried those still it gives me the same error "webpage expired"
i want to mention onething, why we dont disabled the cache, in firefox after u succesfully save the data and hit back button firefox displays the previous data, so after doing some research i found that we need to add "response.setnostore() ....(so that
it wont store cache anywhere)", so that it won't display the previous cache(i thnk this is the same problem in chrome)
plzz let me know if ter is any other alternative,
Nov 20, 2009 09:22 PM|ajay.ms2000|LINK
In the code that redirects to next page, try giving true or false as 2nd parameters.
This may seems weird but try both and lets see.