Returning to same PageIndex in GridView

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ArunDhaJ

    Returning to same PageIndex in GridView

    Hi All,
    I'm having a page with GridView with a link column in it. The gridview
    contains the list of students. Upon clicking the Student name it would
    further take to a Student Details edit page. After editing the details
    and upon click of save, i would simply redirect the page back to
    listing page.

    Now my need is: consider there are 100 students and listed in Gridview
    with page index 10. When I edit a student who is listed in 3rd page,
    upon saving the details the listing page should return back to 3rd
    page.

    Few choices came to my mind like:
    1. Passing the pageIndex back and forth in query string.
    2. Using the student Id and manually looping through the Grid to find
    the record number and calculating the pageIndex from the total records
    and student record number.

    Please suggest whether any of the above way would be better or is
    there any new way....

    Thanks in Advance
    - ArunDhaJ
  • Peter Bromberg [C# MVP]

    #2
    Re: Returning to same PageIndex in GridView

    using the querystring is perfectly fine.
    Peter
    "ArunDhaJ" <arundhaj@gmail .comwrote in message
    news:8f866fbc-5b2c-4b2b-b7a1-bb0bc4e19597@k3 7g2000hsf.googl egroups.com...
    Hi All,
    I'm having a page with GridView with a link column in it. The gridview
    contains the list of students. Upon clicking the Student name it would
    further take to a Student Details edit page. After editing the details
    and upon click of save, i would simply redirect the page back to
    listing page.
    >
    Now my need is: consider there are 100 students and listed in Gridview
    with page index 10. When I edit a student who is listed in 3rd page,
    upon saving the details the listing page should return back to 3rd
    page.
    >
    Few choices came to my mind like:
    1. Passing the pageIndex back and forth in query string.
    2. Using the student Id and manually looping through the Grid to find
    the record number and calculating the pageIndex from the total records
    and student record number.
    >
    Please suggest whether any of the above way would be better or is
    there any new way....
    >
    Thanks in Advance
    - ArunDhaJ

    Comment

    Working...