what is the difference between cache versus viewstate ? RRS feed

  • Question

  • User-1769738303 posted

    when I use a code like this
    Cache.Insert("NewsBlockClassic", DynamicallyCreatedButton);

    questions :

    1-   where cache is storing ? in viewstate ?
    2-   is cache is storing in server per page request pool ?
    3-  any object can be added in cache ? something like viewstate ?

    so I am confused when to use cache and viewstate.

    Thursday, September 15, 2011 5:24 PM


All replies

  • User-131059102 posted

    My understanding is cache typically stores information in memory... also can be files stored on disk or blobs in some cases.

    ViewState stores the info in the page itself... if you looks at the page source on some asp.net sites you will see large chunks of ViewState in the html source... that is what holds the info. 

    Thursday, September 15, 2011 9:34 PM
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 15, 2011 11:02 PM
  • User-1835172754 posted

    cache is somekind of memory and in asp usually is using for lowing the traffic of transmition between server and client by saving some presedure into to the client memory


    viewstate usually using for transmitition some information between pages.

    Friday, September 16, 2011 2:08 AM
  • User1858674461 posted

    Refer this




    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 16, 2011 2:20 AM