如何禁用aspx页面视图状态? [英] How to disable viewstate for aspx page?

查看:325
本文介绍了如何禁用aspx页面视图状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要我的Web应用程序中一个aspx页面完全禁用视图状态。我已经通过不同的博客走了,我的理解是,我们必须设置<%@页的EnableViewState =false的...%GT; 。但是,这是行不通的。我的问题是,wheteher这足以禁用的视图状态的页​​面中的所有控件?或者我应该做任何其他修改?如有任何注明。我不想为aspx页面

I need to completely disable viewstate for an aspx page inside my web application. I have gone through different blogs and what I understand is that we must set <%@ Page EnableViewState="false" ...%> . But this is not working. My question is, wheteher this is enough to disable viewstate for all the controls inside the page? Or Should i make any additional modifications? Please specify if any. I dont want viestate enabled for even a single control inside the aspx page

推荐答案

我觉得行情应该是:

EnableViewState="false"

除此之外,如果你仍然看到了隐藏字段,然后它们被ASP.Net使用。您可能会看到:

Apart from that, if you are still seeing the hidden fields then they are used by ASP.Net. You may see:

<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.page.enableviewstate.aspx\">Page.EnableViewState物业

即使的EnableViewState为false,页面可能包含一个隐藏的视图
  状态字段所使用的ASP.NET检测回发。

Even if EnableViewState is false, the page might contain a hidden view state field that is used by ASP.NET to detect a postback.

这篇关于如何禁用aspx页面视图状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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