开发者

Does ViewState require Server resources? I thought not

开发者 https://www.devze.com 2023-01-31 05:33 出处:网络
I read this somewhere: \"Because the view state for a given page must be kept ON THE SERVER, it is possible for the current

I read this somewhere:

"Because the view state for a given page must be kept ON THE SERVER, it is possible for the current state to be out of synchronization with the current page of the browser, if the user uses the Back feature on the browser to go back in the history"

I suspect that this may not be the default setting but instead an option to store the viewstate on the server, as what would the point of storing the ViewState in the page AND the server be? Am I correct?

If ViewState is stored on the server, how does one avoid the BackButton isue described h开发者_如何学Cere?


ASP.NET ViewState is stored in the client in one (or more) hidden HTML input field. I'd be really interested in seeing where you read that incorrect statement.

The server totally forgets ViewState once sent. As a security measure against tampering, ASP.NET can encrypt it and validate it against its key. If you use a set key (rather than auto-generating one), that view state will be valid even if the server has been shut down and rebooted entirely. All which illustrates that nothing in view state is stored on the server.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号