M
MattB
I have an asp.net 1.1 eCommerce application that has a product page
where the user can select from many different options that affect the
price of the main product. I've implemented this with either a
RadioButtonList or a CheckBoxList that does a postback so I can display
the current price as the user changes options. It works pretty well, but
can do some odd things if the user navigates to the page with the back
button.
I've read up on this quite a bit, and found the following code block to
add to my codebehind to help reduce issues with using the back button:
Response.Buffer = True
Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1)
Response.Expires = 0
Response.CacheControl = "no-cache"
When I use this code on a page that doesn't use auto postbacks, it does
what I want, and that is to display a warning from the browser that the
content is expired.
But on my page that uses all the auto postbacks, the back button just
takes me back to the last postback state and the browser doesn't display
the expired content warning. Can anyone tell me why, or even better how
to make the page not cache even if I use those auto postback controls?
Thanks!
Matt
where the user can select from many different options that affect the
price of the main product. I've implemented this with either a
RadioButtonList or a CheckBoxList that does a postback so I can display
the current price as the user changes options. It works pretty well, but
can do some odd things if the user navigates to the page with the back
button.
I've read up on this quite a bit, and found the following code block to
add to my codebehind to help reduce issues with using the back button:
Response.Buffer = True
Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1)
Response.Expires = 0
Response.CacheControl = "no-cache"
When I use this code on a page that doesn't use auto postbacks, it does
what I want, and that is to display a warning from the browser that the
content is expired.
But on my page that uses all the auto postbacks, the back button just
takes me back to the last postback state and the browser doesn't display
the expired content warning. Can anyone tell me why, or even better how
to make the page not cache even if I use those auto postback controls?
Thanks!
Matt