Solved

Return to same current page index

Posted on 2011-09-02
2
305 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can I add google maps in vb.net. 2 48
How does this modal work? 3 33
EMAIL RANGES BASED ON CURRENT TIME 12 41
VB.net SQL Connection String Read Only 4 17
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’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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