Reputation: 12367
I know the differences between SessionState and ViewState:
Now taking the above into account, if I have plenty of variables(which means that much bandwidth) that I need to keep through postbacks which one should I pick? I stuck in the middle because:
Upvotes: 0
Views: 79
Reputation: 17724
Unless you are speaking of a few thousand variables, there is nothing to worry about.
Most asp.net controls store a lot of their state variables in the ViewState.
You can easily use a page performance tool to see the increase in your page size after you put the variables in ViewState. In most cases it is not something to worry about.
Upvotes: 1
Reputation: 148110
Variables usually do not take much space would be in kbs
or even less, putting data in session un-necessarily could degrade the performance of server as the number of clients increase the load on server machine is multiplied. On the other hand view state does not hold space on server and could save memory for other useful operations.
Upvotes: 1