Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Session("MyDt") and page back question

Posted on 2011-09-16
3
184 Views
Last Modified: 2012-05-12
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
Comment
Question by:Ollie90
  • 2
3 Comments
 
LVL 28

Expert Comment

by:strickdd
ID: 36549158
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
 

Author Comment

by:Ollie90
ID: 36549413
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
 
LVL 28

Accepted Solution

by:
strickdd earned 500 total points
ID: 36549593
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question