What pitfalls arise by using a custom view-state provider?

这一生的挚爱 提交于 2019-12-12 18:26:15

问题


I have recently started researching how to use a custom view-state provider to move storage of viewstate from the page to the server. The obvious advantage of this is reducing the rendered page size and thus, increasing the user experience. Also, the biggest disadvantage that I know of is that server memory usage will increase. For this issue I can easily move the storage to a different server than the web server (AppFabric, for example) Besides this, are there other pitfalls that may arise? Are there situations where one would use the normal view state provider and not a custom view state provider?

I hope my question is clear.

Thanks!


回答1:


Recently I did this in my application and have not had any issue doing so.

But before moving to maintain a custom Viewstate, you have to think of User traffic. If traffic is high then I would not recommend maintaining Viewstate on the server. In that case you have to consider other ways to improve the performance of your application.

Have a look on this very good article an Analysis of Keeping ViewState out of the Page




回答2:


If the thread/process that holds that data crashes you'll lose it (given you're going to store it in memory). Same thing with inproc/aspstateserver session. Sometimes it just crashes = goodbye, data. But it's impossible when your viewstate is stored on page = more reliability.



来源:https://stackoverflow.com/questions/5667365/what-pitfalls-arise-by-using-a-custom-view-state-provider

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!