输出缓存和回传 [英] output Caching and postback

查看:143
本文介绍了输出缓存和回传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果你有一个按钮,并在页面中的文本框,并在页面被缓存在服务器上。

把一个断点在Page_Load中并运行

If you have a button and a text box in a page, and the page is cached on the server.
Put a breakpoint at page_load and run

如果您按一下按钮,在Page_Load断点只对第一次点击访问。

If you click the button, the Page_load breakpoint is visited only for first click.

我试图得到一些解释,而不是Wellll ....唉唉MMMM它是一个回传!

我期待该断点不会在所有被访问,这是一个缓存的页面。

I am trying to get some explanation rather than "Wellll....ahhh mmmm it is a postback!!"
I am expecting that the breakpoint will not be visited at all, it is a cached page.

感谢

推荐答案

您需要使用的VaryByParam OPTON在@OutputCache指令。包括每个指定一个不同版本的页面中提交的字段名。例如:

You need to use the VaryByParam opton in the @OutputCache directive. Include each of the submitted field names which specify a different version of the page. For example:

<%@的OutputCache的VaryByParam =姓氏; FIRST_NAMEOtherAttributes =...%GT;

这将缓存不同版本的页面在发布的数据姓氏和FIRST_NAME的每个组合。

This will cache a different version of the page for each combination of last_name and first_name in the posted data.

这篇关于输出缓存和回传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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