如何在ASP.net页中禁用ViewState [英] How to disable viewstate in a ASP.net page

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

问题描述

如何在ASP.net页面中禁用viewstate,我在页面中执行了以下语法,但该死的viewstate仍在页面中启用.

How to disable a viewstate in ASP.net page, I did the below syntax in my page, but still the damn thing viewstate is being enable in my page.

enableviewstate=false;


而我的代码仅包含一条语句,即response.write("Hi");
执行页面并在浏览器中查看viewsource后,viewstate值以我不想要的编码格式显示.

请帮帮我

在此先感谢

问候
Chandu


and my code contains only one statement i.e is response.write("Hi");
after i execute the page and see viewsource in browser, viewstate value is showing in encoded format which i dont want.

Please help me

Thanks in advance

Regards
Chandu

推荐答案

嘿,尝试一次,您应该对控件使用EnableViewState属性
如下.
Hey try it once, you should use EnableViewState property for a Control
like as follow.
DropDownList1.EnableViewState = false;


Google揭示了所有内容.当我用谷歌搜索"asp.net disable viewstate"时,我得到了132,000个结果.这是其中之一:

http://www.ironspeed.com/articles/Disable%20View% 20State%20for%20a%20Page/Article.aspx [ ^ ]
Google reveals all. When I googled "asp.net disable viewstate", I got back 132,000 results. Here''s one of them:

http://www.ironspeed.com/articles/Disable%20View%20State%20for%20a%20Page/Article.aspx[^]


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

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