How to disable View State MAC globally?

南楼画角 提交于 2019-11-27 23:41:57

问题


I'm tired of including

EnableViewStateMac="false"

in every page. How to do that globally?


回答1:


You can disable it on the <pages> element in the web.config, like this:

<configuration>
  <system.web>
    <pages enableViewStateMac="False" />
  </system.web>
</configuration>



回答2:


The answer above explain to you how to set it in the Web.Config, but look at MSDN and you will see what it says here:

This attribute should never be set to false in a production Web site, even if the application or page does not use view state. The view state MAC helps ensure the security of other ASP.NET functions in addition to view state.



来源:https://stackoverflow.com/questions/2645468/how-to-disable-view-state-mac-globally

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!