This is a migrated thread and some comments may be shown as answers.

Load previous page with it's viewstate

1 Answer 28 Views
Miscellaneous
This is a migrated thread and some comments may be shown as answers.
ShawnAugust
Top achievements
Rank 1
ShawnAugust asked on 18 Jan 2008, 03:52 PM
Hello:

I know that plenty of people have tried to address this but I haven't found a consensus on how to resolve this problem:

Reloading a previous page with its view state.

A real world example:

A search page that displays search results. Click on an item and the application brings the user to a details page. A Back To List button exists and when clicked, the user is brought back to the search page with its previous state in context.

My application:

Page 1 displays records within a DataGrid and has various controls. A button redirects the user to Page 2 using cross-page postback.

Page 2 displays various data from Page 1 using .NET's PreviousPage object. A button redirects the user back to Page 1 using Response.Redirect.

There are a million and one ways to to do this but I am trying to have Page 1 re-display with the view state that it had before leaving for Page 2. The same data loaded in the controls, the same selections made in the controls, the same page of records loaded in the DataView.

Currently, it just re-loads Page 1 with it's initial values.

I've tried JavaScript history and looking into overwriting Page 1's view state but ViewState is not available within the PreviousPage object.

Does anyone have some advice?

1 Answer, 1 is accepted

Sort by
0
ShawnAugust
Top achievements
Rank 1
answered on 21 Jan 2008, 03:43 PM
TTT
Tags
Miscellaneous
Asked by
ShawnAugust
Top achievements
Rank 1
Answers by
ShawnAugust
Top achievements
Rank 1
Share this question
or