Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable View State MAC globally?

I'm tired of including

EnableViewStateMac="false"

in every page. How to do that globally?

like image 578
Jader Dias Avatar asked Apr 15 '10 13:04

Jader Dias


2 Answers

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

<configuration>
  <system.web>
    <pages enableViewStateMac="False" />
  </system.web>
</configuration>
like image 129
Nick Craver Avatar answered Oct 13 '22 12:10

Nick Craver


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.

like image 39
Has AlTaiar Avatar answered Oct 13 '22 11:10

Has AlTaiar