在哪里存储ViewState的? [英] Where is ViewState stored?

查看:192
本文介绍了在哪里存储ViewState的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在哪里是ViewState的存储?它是存储在服务器或客户端?

Where is a ViewState Stored? Is it stored in Server or Client Side?

我有应存储一些处理的巨大的数据。我使用会话。但是,从一个页面移动到另一个时,即时通讯无法清除会话。所以我想实现的ViewState的。但随着数据的ViewState的大量运行时,抛出的错误?

I have a huge data which should be stored for some process. I was using Session. But when moved from one page to another im not able to clear the session. So I thought of implementing ViewState. But when running with huge amount of data ViewState is throwing error?

我怎样才能解决这个问题?

How can I resolve this?

推荐答案

视图状态存储在网页它的自我在连接codeD形式。你不能访问客户端视图状态以直接的方式。你需要知道的编码/解码算法从该视图状态在客户方code获取有价值的数据。

Viewstate is stored on page it self in encoded form. You can't access the viewstate in client side in a direct manner. You need to know the encoding/decoding algorithms to fetch the valuable data from this viewstate in clientside code.

您可以使用隐藏变量来存储将仅在该网页上使用的数据。隐藏的变量是从客户端和服务器端code访问。

You can use hidden variable to store data that will be used only on that page. Hidden variables are accessible from client side and server side code.

您可以使用高速缓存或会话存储数据表(大数据)。他们将作为比较的ViewState不错的表现。

You can use Cache or session to store datatable (large data). They will have good performance as compare to ViewState.

缓存为始终使用机器的内存,会话使用什么样的已经配置:

The Cache is always using the machine's memory, the Session uses what has been configured:

在一个Web场会话可以是本地(仅当亲和力设置其中工程)或远程(状态服务器或数据库,或自定义),但缓存始终是本地的。

In a web farm the Session can be local (which works only if affinity is set), or remote (state server or database, or custom), but the cache is always local.

所以,在高速缓存中存储的数据表会消耗内存,但是它不会使用序列化。

So, storing a DataTable in the cache will consume memory, but it will not use serialization.

PS:存储数据集,而不是一个DataTable将改变几乎没有什么

PS: storing a DataSet instead of a DataTable will change almost nothing.

参阅缓存实现

这篇关于在哪里存储ViewState的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆