Solved

Return to same current page index

Posted on 2011-09-02
2
304 Views
Last Modified: 2012-06-27
Hello all. I've got an asp datagrid that has 1000's of records depending on the day. Each page is set to display 200 max records per page so you could be 4 or 5 pages into it. The items in the data gird are links to a different page to provide record information.

Once you are on the individual record's information page there is a back button to return back to the data grid.  The code for the back button is simply:

 MyBase.Redirect("SearchInProcessTransactionResults.aspx")

The only issue is it doesn't return you to the current page index you were on it automatically takes you back to the first page of the datagrid effectively losing your place, which isn't ideal seeing you may have been on page 8 for example or not even remember what page you were on.

On the datagrid page i move between the pages just by using the dgResults.CurrentPageIndex function. What is the best way to get back to the currentpageindex you left off on when return from a records information page?

 
0
Comment
Question by:judsonV
2 Comments
 
LVL 19

Accepted Solution

by:
Bardobrave earned 500 total points
ID: 36472913
You must send your current page index to data individual record's page so it's able to return back this value to the datagrid when clicking back button.
0
 
LVL 13

Expert Comment

by:devlab2012
ID: 36473230
Save the value of dgResults.CurrentPageIndex into Session, e.g. In the PageIndexChanging event:
Session["MyIndex"] = dgResults.CurrentPageIndex;

Before binding the grid, check the value of Session["MyIndex"] and use this value to display the records in the grid.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question