Click here to Skip to main content
15,904,652 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

In grid, I want to maintain a data in-between some events and later that I have to insert into the database.

This grid have the functionalities to insert,update and delete the records.

The no of records are also large in the Grid.

Please suggest which is the best practice I would follow (View State/Session State).

Thanks
Posted
Updated 11-Nov-11 9:32am
v2

If you're staying on the same page, then ViewState would be the way to go. If you're looking to maintain the state of your uncommitted data across several pages you should use SessionState.
 
Share this answer
 
Comments
RaviRanjanKr 11-Nov-11 15:27pm    
My 5+
If Data is more and u need to maintain along the pages go for Sessions.
 
Share this answer
 
Comments
shek124 27-Oct-11 9:51am    
If the session expires, Can I able to retrieve the session data again?
plz suggest..
jim lahey 31-Oct-11 10:06am    
You can handle the Session_End event of the HttpApplication and serialize the contents of the session to disk.
sabbi26 28-Oct-11 0:59am    
Once the session expires the data in the session cache is no more.If u want to maintain the session for long time set the session timeout property to more in web.config.
If ur page contain any secured info pls avoid sessions with longer timeout values.
<![CDATA[<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="EmpInfo.aspx.cs" Inherits="EmpInfo" %>
 
Share this answer
 
v2
Comments
RaviRanjanKr 11-Nov-11 15:28pm    
Always wrap your code in "Pre" tag.
It would be better if you use viewstate if you are not transferring data from one page to another.
 
Share this answer
 
v2
Comments
RaviRanjanKr 11-Nov-11 15:30pm    
[Edited]Corrected short texts to appropriate words[/Edited]
A suggestion :- Never use short texts like 'U' instead of "You" and 'r' instead of "are".

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