ViewState Vs Session … maintaining object through page lifecycle

前端 未结 3 1327
予麋鹿
予麋鹿 2020-12-08 06:24

Can someone please explain the difference between ViewState and Session?

More specifically, I\'d like to know the best way to keep an object available (continuously

3条回答
  •  余生分开走
    2020-12-08 07:13

    The view State is page specific, where as Session state is browser specific. You can not able to pass the data from one page to another through view state. But you will do with session state. Each session has some unique ID , Where as View state stored data in hidden fields on page itself.Session store the data on server side, where in view state data stored on page, hence it make the page heavy and application slow. Each control has view state true by default which store its state(control state), we can enable or disable it easily by making enableviewstate=false

提交回复
热议问题