Differences between Session and ViewStates?

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2005
Posts: 19
Reputation: cumadhu is an unknown quantity at this point 
Solved Threads: 0
cumadhu cumadhu is offline Offline
Newbie Poster

Differences between Session and ViewStates?

 
0
  #1
Dec 7th, 2005
Hi All,
I would like to know the differences between Sessions and Viewstates. And best uses of Sessions and Viewstates.

Thanks and with regards,
Madhusudhan
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Differences between Session and ViewStates?

 
0
  #2
Dec 7th, 2005
"Session" is data stored per user session. "Viewstate" is an ASP.NET thing. It's a way for the application to maintain state about a particular form and its child controls. Your ASP.NET application might consist of several pages/forms. There might be a piece of data that you want to access across all pages. You could place that in a Session variable. However, you rarely need to worry about ViewState, ASP.NET manages that itself.

I've written some articles that discuss Viewstate: http://www.tgreer.com/aspnet_html_02.html

This article shows how you might use Session: http://www.tgreer.com/aspnet_html_04.html
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC