SunQuest
           ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 7th, 2003, 04:41 AM
Uga Uga is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Moscow
Posts: 21 Uga User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
"Back" button issue on ASP generated data tables

Imagine an asp-script that retrieves data from a database and returns an HTML with table of the retrieved data, allowing user to edit some values and delete rows. The issue occurred after deleting a row. Lets say the initial table was:

Table 1

Id | Name | Description | Delete Action
-------------------------------------------------
1 | BMW | i735 | [ Delete ]
2 | Lada | i1.5 | [ Delete ]

[Save changes]

When user presses the [ Delete ] button for BMW, the row is deleted by a delete.asp and the page is redirected back to list the new results:

Table 2

Id | Name | Description | Delete Action
-------------------------------------------------
2 | Lada | i1.5 | [ Delete ]

[Save changes]

This works perfectly. But now, of course, the previous view (Table 1) was added to the web browser's history. I press "Back" button in the web browser and see the following:

Table 3

Id | Name | Description | Delete Action
-------------------------------------------------
2 | BMW | i735 | [ Delete ]

[Save changes]

Issues:
1. Table 3 contains only one row, while the actual previous view (Table 1) contained a table with two rows.
2. The Id number is taken from Lada (Table 2).

It is ovbious, that the reason lies in the fact that Id is not an input, thus not editable, while Name and Description are inputs inside a form and can be edited. The number of rows must have been improperly cached by the web browser, most probably the form containing the table was overwritten in the cache.

I would be grateful if someone explained the actual reason of such behaviour. Also, could someone tell me how to force refreshing the page when navigating with "Back" and "Forward" buttons? That would solve the problem.

Uga

Reply With Quote
  #2  
Old July 7th, 2003, 08:08 AM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
A solution taken by some is to use sessions, which may invalidate a session when the user hits the `Back` button and display the `This page is expired` message. You could also create your own navigation and advise your users to use that instead of the Browser buttons.

Reply With Quote
  #3  
Old July 7th, 2003, 09:40 AM
Uga Uga is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Moscow
Posts: 21 Uga User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanx

Reply With Quote
  #4  
Old July 8th, 2003, 06:23 PM
kkong's Avatar
kkong kkong is offline
Monkey Magic
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: UK
Posts: 103 kkong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to kkong
have you tried adding the response.expire headers to the top of the page.

I think this forces the page to re-load the page again instead of using the cached version.

Kong.

Reply With Quote
  #5  
Old July 9th, 2003, 04:15 AM
Uga Uga is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Moscow
Posts: 21 Uga User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Response.Expires = x

did not help where values for x were 0 and
-1000

Reply With Quote
  #6  
Old July 9th, 2003, 06:27 AM
kkong's Avatar
kkong kkong is offline
Monkey Magic
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: UK
Posts: 103 kkong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to kkong
ok, give this a go:

Code:
Response.ExpiresAbsolute = #1/1/1980#
Response.AddHeader "cache-control", "no-store, must-revalidate, private"
Response.AddHeader "Pragma", "no-cache"
Response.Buffer = True


Kong.

Reply With Quote
  #7  
Old July 10th, 2003, 02:07 AM
Uga Uga is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Moscow
Posts: 21 Uga User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It worked!
Actually
<% Response.AddHeader "cache-control", "no-store, must-revalidate, private"%>
was enough.

Thank you very much.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > "Back" button issue on ASP generated data tables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway