Solved

Session("MyDt") and page back question

Posted on 2011-09-16
3
183 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
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…

809 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