Click here to Skip to main content
15,890,947 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Programmers,

I have implemented paging in Gridview and in order to avoid frequent Reconnection with database,I used Session to store data.So that data could be retrieved from session on changing page index of Gridview.
But my problem is that when should I clear this session as it's usable only for this very page.And if I use ViewState then it will not be fine if data increases in amount.



Looking forward for valuable suggestion of yours.....
Thanks in advance
Supriya
Posted
Comments
rockpune 9-Feb-12 5:41am    
send me ur code

1 solution

If you prefix the session key with ClientID[^] or UniqueID[^] like:

Session[gridView.UniqueID + "_DataForGrid"] = gridItems;


You should be able to solve your problem.

Best regards
Espen Harlinn
 
Share this answer
 
Comments
thatraja 9-Feb-12 8:03am    
Good call, 5!
Espen Harlinn 9-Feb-12 8:04am    
Thank you, thatraja :)
Sergey Alexandrovich Kryukov 9-Feb-12 12:35pm    
Sure, a 5.
--SA
Espen Harlinn 9-Feb-12 15:29pm    
Thank you, Sergey!
Supriya Srivastav 10-Feb-12 3:51am    
Thank you so much....Espen Harlinn
a 5,from me 2.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900