|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
"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 |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
Thanx
|
|
#4
|
||||
|
||||
|
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. |
|
#5
|
|||
|
|||
|
Response.Expires = x
did not help where values for x were 0 and -1000 |
|
#6
|
||||
|
||||
|
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. |
|
#7
|
|||
|
|||
|
It worked!
Actually <% Response.AddHeader "cache-control", "no-store, must-revalidate, private"%> was enough. Thank you very much. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > "Back" button issue on ASP generated data tables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|