当前位置:编程学习 > C#/ASP.NET >>

如何只对个别控件使用 EnableEventValidation="true"?

  如何只对个别控件使用 EnableEventValidation="true"? --------------------编程问答-------------------- 整个页面用 如何只对个别控件使用 EnableEventValidation="false"的情况下 --------------------编程问答-------------------- 这个还真的没有尝试过,不知道楼主是什么原因要这样子做? --------------------编程问答-------------------- 原因是很多控件生成的__EVENTVALIDATION实在是大的出奇,在对整个页面使用EnableEventValidation="false"的情况下,可以消除,但为了安全起见,还是要对个别控件使用EnableEventValidation="true"加以验证 --------------------编程问答-------------------- ddddddddddddddddd --------------------编程问答-------------------- 在web.config配置文件中,你可以单独对某些页面进行配置,你在外面默认配置为enableEventValidation="false",然后对你特殊的页面像下面这样配置,就可以达到你的要求了:

<configuration>
    <location path="YourPage.aspx">
        <system.web>
            <pages enableEventValidation="true">
            </pages>
        </system.web>
    </location>
</configuration>
--------------------编程问答--------------------
引用 5 楼 qq546937127 的回复:
在web.config配置文件中,你可以单独对某些页面进行配置,你在外面默认配置为enableEventValidation="false",然后对你特殊的页面像下面这样配置,就可以达到你的要求了:
XML code<configuration><locationpath="YourPage.aspx"><system.web><pagesenableEventValidation="true"></pages></system.web></location></configuration>


是只针对某个控件,不是页面 --------------------编程问答-------------------- 好像页面中有文本编辑器时需要设置这个:EnableEventValidation="true" --------------------编程问答-------------------- DDDDDDDDDDDDDDD
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,