开发者

How much data can ViewState store?

I having a viewstate to store a data query from SharePoint,

where the data might be very huge,

the reason why I wanted to store in viewstate is for later filter on the queried data.

However, I not sure whether it might caused any performance issue as there a开发者_开发百科re alot of data (rows and columns), because as I know viewstate will consume client browser's memory.

so actually how much data can viewstate store?


Yes, it can absolutely cause performance issues because it increases the size of your page. ViewState is capable of storing much more data than you should ever store there because of performance issues.

I would explore other options such as caching, etc.


Viewstate data is sent to and from the server to client on each and every postback thus causing the user to download that information every time. The more data stored in viewstate, the slower the page will load.

But to answer your question, there is not a size limit to viewstate.


The ViewState, if I remember correctly, is embedded in the source (look for <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="xxxxxxxx" />). Having a lot of data in the ViewState will cause your pages to POST more bytes with every request (and you'll need to do POSTs to access that ViewState). There's also the cost of decrypting that ViewState data (though I have no idea what kind of impact that might have...).

Hope this helps!


Not only will ViewState use memory in the user's browser, it will also slow performance of page loads because the browser has to send/receive all that data to/from the server each time.

Like others have said, you're much better off using the server-side session state, or a server-side cache.


When you are using ViewState it has get from the server and will cause performance issue. Also user browser may affect the performance.

while there is no published limit to the max size of a hidden field (implementation of viewstate) and most browsers allow large sizes, some proxy servers are known to limit them to 4k.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜