Solved

Session("MyDt") and page back question

Posted on 2011-09-16
3
185 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
[X]
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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 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