Solved

Return to same current page index

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

895 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

16 Experts available now in Live!

Get 1:1 Help Now