how to maintain page index of gridview on page refresh in asp.net c#

Posted by Prabu_Spark under ASP.NET on 6/24/2013 | Points: 10 | Views : 1676 | Status : [Member] | Replies : 1
Hi sir,
Tell me the steps to maintain page index of gridview on page refresh in asp.net c#. I am refreshing my page for every 20 seconds.
If i am viewing the 10 th page in gridview, after the page refresh i need to maintain the same 10 th page. Kindly give me the
solution for this problem.


[Note: I am refreshing my page for every 20 seconds to get the updated records from the database to gridview]

With regards,
J.Prabu.
[Email:prbspark@gmail.com]



Responses

Posted by: Justshekhar123 on: 6/24/2013 [Member] Starter | Points: 25

Up
0
Down
Hi J.Prabu ,

To maintain page index of gridview on page refresh, you can simply store the pageindex value of that gridview control in the viewstate or session or static variable. after on next time when you are going to bind the data to that gridview control, set that value to gridview like:

gridView.PageIndex = "yourvalue";

Thanks & Regards,
Shekhar jadhav

Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response