Architecture

ASP data storing models

http://forums.asp.net/t/1520451.aspx/1

Session

Goal: saving data specific to the user, during his session
Stored: in a session variable on the server

HttpContext.Current.Session["sessionVariableName"]

Advantages: does not use much of your bandwidth and it is secure because it is on the server
Disadvantages: is kept on the server for every session, so uses lots of memory on the server

View state

Goal: saving date on a page between post backs
Stored: in a 'hidden' page input

ViewState["viewstateName"]

Advantages: simple for page level data, doesn't use memory on the server, encrypted
Disadvantages: uses a lot of bandwidth (is send back and forward with every postback), only for one page

Query string

Goal: passing data between pages
Stored: in the URL
Advantages: simple to implement, doesn't use memory on the server nor bandwidth
Disadvantages: human readable and changeable, client browser limit on URL length

Cookie

Caching

Goal: caching data that is not user specific but app wide
Stored: on the server

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License