PDA

View Full Version : "Back" Button Issue concernong tables


Uga
07-04-2003, 03:07 AM
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 rows is deleted and the page is redirected to list the new results:

Table 2

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

[Save changes]

Of course, the previous view was added to the 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 the table viewed after deleting (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 using "Back" and "Forward" buttons?

I also attach the asp-script and html file included in the script.

Uga

MikeParent
08-24-2003, 08:27 AM
Without the code it is difficult to say. Can you post the code?