Solved

Session("MyDt") and page back question

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now