【问题标题】:Output cache does not work with postback on usercontrol输出缓存不适用于用户控件上的回发
【发布时间】:2013-10-01 12:10:00
【问题描述】:

我有一个页面,其中有 4 个用户控件。其中1个用于过滤掉其他控件的内容。我在该控件中有复选框,例如按性别过滤,按大小和颜色过滤等......

我在我的页面上添加了以下代码用于缓存。当您像选择性别复选框一样过滤它时,它似乎可以工作 2-3 次,并且它可以工作,如果您选择大小过滤器它可以工作,但是如果您再次选择性别过滤器它不起作用并且其他控件不显示任何结果消息。当我知道有结果时,因为它第一次确实有效。

我在每个过滤器上添加了一个查询字符串参数,以便我可以返回结果。

<%@ OutputCache Duration="300"  VaryByParam="*"  %>  

查询字符串

http://somwsite.com/jacktes/?n=0&lp=&hp=&size=&colour=&g=MENS

我试过以下没有运气。

 <%@ OutputCache Duration="300"  VaryByParam="none" VaryByControl="GenderFilter" %> 
 <%@ OutputCache Duration="300"  VaryByControl="GenderFilter" %> // ID of the checkbox List
 <%@ OutputCache Duration="300"  VaryByParam="n;lp;hp;size;colour" %> // ID of the querystring param

谁能帮我解决这个问题?

Note: No error message as page works fine BUT out of 4 control the control which shows the filter results is displaying no results.

【问题讨论】:

    标签: asp.net caching outputcache


    【解决方案1】:

    在尝试找到更好的解决方案时偶然发现了这一点 所以基本上有一个解决方法: OutputCache returns invalid version with PostBack

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-08
      • 1970-01-01
      • 2012-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-25
      相关资源
      最近更新 更多