Author: MdV | Posted on: 5/28/2009 2:33:26 AM | Views : 1320

On a webpage I have a GridView, which can be sorted and paged. From that 1st webpage the user can go to a 2nd page to edit the selected record in the GridView (= a detailspage).
Once finished with editing (or upon cancelling), I want the user to be redirected to the 1st page with the GridView again, but I want him to land on the same gridview 'page' (paging) and with the same sort status as when he left.
Thus I want the GridView page to return to the same ViewState as it had when the user moved to the 2nd webpage to edit the selected record.
Right now I'm saving the previous page in ViewState on the 2nd page via:
ViewState("ReferrerURL") = HttpContext.Current.Request.UrlReferrer.ToString()
And I do a redirect to ViewState("ReferrerURL" Go to the complete details ...