开发者

Saving Viewstate on Server

开发者 https://www.devze.com 2023-02-03 15:30 出处:网络
What is the best way to save view state on server? Is it a good idea to u开发者_运维问答se a WCF service to save the view state on the server?Are we talking about ASP.NET view state? Why do you need

What is the best way to save view state on server?

Is it a good idea to u开发者_运维问答se a WCF service to save the view state on the server?


Are we talking about ASP.NET view state? Why do you need WCF to store view state on the server? ASP.NET provides its own methods to store view state on the server:

  • You can override SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium on your Page.

  • You can override PageStatePersister property of your Page (or in custom PageAdapter). This property by default returns HiddenFieldPageStatePersister but you can change it to SessionPageStatePersister or implement custom PageStatePersister. Here you can read about PageStatePersisters.


There's a project on CodeProject that you should look at called Efficient Server-Side View State Persistence. This meets the following criteria:

  • The View State needs to be persisted on the server.
  • The View State persistence mechanism needs to be identified by a specific user session.
  • The persisted View State artifact must not be allowed to remain forever.
  • The persisted View State should be able to be enabled and disabled on a page by page bases.
  • Different persistence mechanisms should be able to be used.
  • Page development and structure should not be modified.
0

精彩评论

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