How do I restore a pages data when it is posted from another page.

For the life of me I can't figure this out and it should not be so hard to understand !
I have two pages in my application.
On page 1 I have a gridview which display bound objectdata source data.
When someone decides to edit a row in the gridview they are taken to another page via a link with a datasource key.
What I would like to know is if I place a button on page2 that points to Page1 how and in which event do I save the loaded
gridview ?
I tried saving just the Objectdatasource filter in the page unloading and then restoring it to the ODS and rebinding during the postback.
This didn't work.
I also tried setting the cache property on the ODS.
Didn't work
View state is enabled on my ODS too.
So can you go from one page to another and then return to a prior page and have it look just like it did when you were there initially ?
GMann - Totally confused !
5/4/2009 8:34:57 PM
📃 8807 articles.

💬 2 Replies

Some additional thoughts.
This probably is considered crosspage posting.
I tried setting the PostBackURL on by URL button on page 2 and then adding the @output directive on page 1.
But then my gridview selection, which I change through a DDL gets hijacked by the cache duration value.
SO is another way to solve this ?
5/4/2009 11:35:22 PM
If you modify the data on Page2 and you have a button that directs the user back to Page1, you could just DataBind the GridView in the page load event for Page1.  So if anything is changed by the user on Page2, those changes will be displayed in the GridView control.

Malcolm Sheridan
Microsoft Certified Solution Developer
Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as
Answer" if a marked post does not actually answer your question.
5/5/2009 12:18:34 AM