How to disable View State MAC globally?

2019-01-25 07:46发布

I'm tired of including

EnableViewStateMac="false"

in every page. How to do that globally?

2条回答
祖国的老花朵
2楼-- · 2019-01-25 08:32

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.

查看更多
我只想做你的唯一
3楼-- · 2019-01-25 08:42

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

<configuration>
  <system.web>
    <pages enableViewStateMac="False" />
  </system.web>
</configuration>
查看更多
登录 后发表回答