• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

Session("MyDt") and page back question

i use Session("MyDt") to keep certain content 'in memory' and that content will be shown in a gridview. All works fine.

So, i someone hits delete in the gridview, the row in the gridview will be deleted and the Session is updated.
All works fine..

But now someone deleted a row from the gridview and made a mistake by deleting it and hits page back in IE.
the previews gridview will show (2 rows instead of 1), but the Session is not updated.

Now can i update my Session if someone hits page back in IE? is there an event for this?
0
Ollie90
Asked:
Ollie90
  • 2
1 Solution
 
strickddCommented:
First, you can try putting this in your Page_Load function:

Response.Cache.SetCacheability(HttpCacheability.NoCache)

The next option is to step through the code and make sure that the you can reproduce this issue. Once it it removed from the session, it shouldn't get added back in unless you have code to do that. If you can reproduce, step through the code on the back button click and watch the session variable, see at what point the deleted row is added back.
0
 
Ollie90Author Commented:
i can reproduce .. when you say .. 'back button'.. do you mean an ASP.net button? because i dont have that on my page .. i'm taking about the Internet Explorer page back button.


SetCacheabilty doesn't work
0
 
strickddCommented:
Yes, the browser back button.

1. Load Page
2. Delete Row
3. Set break-point
4. Click browser back button
5. Step through
6. Watch the session variable to see when the deleted row gets added
7. Figure out why
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now