When should I use SessionState to store variable values?

Can I say something like

"If you have these situations, then SessionState must be used to store your values ​​between postbacks."

Can you list me the main reasons why the asp.net developer switches the SessionState from ViewState or HiddenFields or querystrings?

thank

+3
source share
4 answers
  • Sometimes this saves effort when you have a custom object that will travel as it is, as long as the user navigates more than two pages.

  • , , , , , , aspx ( , )

+4

,

. , viewstate, hiddenfields querystring. 3 .

, , , , , , SQL-.

+1

, , /, , .

, , -.

ViewState, , .

, , .

+1

:

  • If you have a relatively large amount of data that you want to associate with the user. In these cases, the ViewState is very slow if you are dealing with postbacks (something over 150K can really slow down the crawl responses), and the request is completely inappropriate (due to the size of the URL, as well as the strict length restrictions imposed by the web -services and browsers.)
0
source

Source: https://habr.com/ru/post/1756539/


All Articles