Click here to Skip to main content
15,888,202 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to store the datatable in to viewstate so that next time i can get the records from viewstate instead a new query from database, But it is working very good on Localhost but on server it is taking too much time with same code and same SPs.

or tell me is there any other way to do the same thing so that i can get the data from client side without any repeated hits on server.
Posted

1 solution

Why you want to store it in a ViewState??

For this kind of scenarios people mostly use sessions as better option. For details check this link: Exploring Session in ASP.NET[^]
 
Share this answer
 
Comments
Ravi Kumar Shakya 12-Jul-13 3:29am    
i already told you i want the data only for that perticular search page. then i dont think it will better to store in a session and for every new search viewstate can easily chamge but we cant change session automatically as viewstate.
Mohammed Hameed 12-Jul-13 4:52am    
What is the need for 50k records to be fetched at a single time? Cant you reduce it and bring only some minimum set of records.
One more thing, viewstate should not be used for huge data instead you can try using catching.
Also, there is no rule that if data is meant for a particular page then Session should not be used. You can even try once using Session.

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