Click to See Complete Forum and Search --> : Retain information & mode in ASP.NET Page


ishwarya
06-19-2004, 02:28 AM
Hi,
I have a datagrid in my web page and it is a paging grid. In the grid i

have say 10 pages and i go to the 5 th page of the grid. On clicking of a record

in the grid, iam redirecting to a new page which shows the details of that

record.
I have a cancel button in this page. On clicking of the cancel button i redirect

to the first page. When iam redirected to the first page, i see the datagrid

records in the 1st page. My problem is since i have clicked the record in the 5th

page of the datagrid, i want that page to be opened when i come back to that

screen.

I use response.redirect.
In the page load of the first page i populate the grid with records.

What should i do to achieve my goal.

Suggestions are welcome

Thanks,
Ishwarya

geirdude
06-21-2004, 09:12 AM
OK, here is one that will work:

Since you already have implemented paging you obviusly have access to the current page number in the grid.

Pass the page number to the detail page as a querystring (?page=n)

Store this page number in a Session variable(!)

In your grid page, check if Session variable set and perform paging as necessary. Clear the Session variable when done so normal paging will work.