Solved

Return to same current page index

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now