是否有任何其他的方式来存储比视图状态的其他数据源? [英] Is there any other way to store the data source other than view state?

查看:106
本文介绍了是否有任何其他的方式来存储比视图状态的其他数据源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有在其上编程所创建的数据表,如果该数据是不存在在数据库表中的页面。我回发时使用此数据表中的许多事件。该数据表可含有数百个记录和可能有多个用户在访问同一页(当然与为每个用户不同的数据源)。我存储视图状态中的数据表,但恐怕这种做法将会使页面更重。是否有任何其他方式preserve跨越postbacks.The code数据表是很长,所以我不能复制和过去在这里。

I have a page on which data table is created programmatically if the data is not there in the database tables. I have to use this data table in many events during postbacks. The data table may contain hundreds of records and there may be multiple users accessing the same page(Of course with different data source for each user). I am storing the data table in view state but I am afraid that this practice will make the page heavier. Is there any other way to preserve the data table across postbacks.The code is very long so I can not copy and past it here.

使用会话将再次使整个应用更重......因此,它是更好的选择了视图状态?

Using session will again make the whole application heavier...So is it better choice over viewstate??

推荐答案

在你的情况的视图状态可以得到非常大,会伤害到页面加载性能。恕我直言,最好的办法是修改你正在处理后回事件的方式。

In your case the view state can get very big and will hurt page load performance. IMHO the best thing would be to revise the way your are handling the post back events.


  • 如果多个用户需要相同的数据使用缓存。

  • 使用会话如果数据是特定于每个zuser。但请记住,如果你是在一个
    聚集invironment它有一些缺陷。

  • 从数据库每次加载数据的用户回发到服务器。在服务器上没有Statehandling需要做的事情,但你失去的性能,同时做一个网络往返。

有关速战速决我通常在服务器上存储视图状态。请参阅本页面以了解它... <一个href=\"http://aspguy.word$p$pss.com/2008/07/09/reducing-the-page-size-by-storing-viewstate-on-server/\" rel=\"nofollow\">http://aspguy.word$p$pss.com/2008/07/09/reducing-the-page-size-by-storing-viewstate-on-server/

For a quick fix I usually store the View State on the server. Refer to this page to read about it... http://aspguy.wordpress.com/2008/07/09/reducing-the-page-size-by-storing-viewstate-on-server/

这篇关于是否有任何其他的方式来存储比视图状态的其他数据源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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