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

问题描述

我需要为Web应用程序中的.aspx页面完全禁用ViewState.我浏览了不同的博客,但我了解到,我们必须设置<%@页面EnableViewState ="false" ...%> ,但这是行不通的.

I need to completely disable ViewState for a .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.

这足以禁用页面内所有控件的ViewState吗?还是我应该做其他修改?如果是这样,请指定它们.我不希望为.aspx页内的单个控件启用ViewState

Is this enough to disable ViewState for all the controls inside the page? Or should I make any additional modifications? If so, please specify them. I don't want the ViewState 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:

Page.EnableViewState属性

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

09-05 12:23
查看更多