I would like to know the differences between Sessions and Viewstates. And best uses of Sessions and Viewstates.
Thanks and with regards,
"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
Both Session and ViewState are a way of storing data. The following are the differences.
.1) Session is for per user session. ViewState is for a page. ie. Storing data in a session variable will last till the session ends. Whereas storing data in ViewState will last only till the page is in live.
2) Session is server type storage where as ViewState is client side type storage.
3) Session variables are stored in a SessionStateItemCollection object that is exposed through the HttpContext.Session property. ViewState variables are stored in hidden fields.
4) When using a SessionState Mode other than Inproc, the session variable type must be either a primitive type or serializable. This is because the session-variable is stored in an external data store. There is no mode for ViewState. By default, serialization of data will be taken care by the viewstate.
diff. between cookie and session
Sir I have these codes
and autocomplete.php has ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
I'm working in Excel to extract content of a table from a web page and populate Excel sheet cells with it. I'm trying to extract data from a table that gets loaded to a web page after show results method gets called. I have an error that says "Run-time error ...