Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm having trouble with a simple ASP.NET application and the back button after a post back.

The page in question has a simple form on it, some text fields etc, and a dropdown that does a postback (autopostback).

The "normal" flow is the user fills out the form and perhaps changes the dropdown. Based on the dropdown value the page content might change.

The problem I'm having is that after the user has changed the dropdown and the postback has completed then the user clicks the back button. They see a "webpage has expired" message from IE.

I've set the following:

Response.Cache.SetExpires(DateTime.Now.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.Private);
But that doesn't seem to have nailed the problem.

The actual Cache-Control response header reads as: private, no-cache:"Set-Cookie"

In a classic ASP application the with a Cache-Control response header of just "private" the back button behaves as expected after a "post back".

Is there anyway to force ASP.NET to set the cache-control explicitly to exactly "private"? Or any other solution that results in the back button and postbacks working well together?

Thanks!
Posted

1 solution

This seems to be awful problem, Can you post your whole code?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900