Solved

Return to same current page index

Posted on 2011-09-02
2
303 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

776 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