tags:

views:

396

answers:

1

I am getting "Validation of viewstate MAC failed" and from what I heard you could add enableviewstatemac = false on each page or web.config, so instead of changing into every page can I just change in master' page so that I don't have to change on all the pages.

+2  A: 

The Message Authentication Check is off by default, so someone must have turned it on for a reason.

I'm not sure if you can set it on the Master page - it's a page directive, but it might work on a Master declaration. However if you want to turn it off for all pages on the site, then updating the web.config would be the simplist option - then if you add a second master page later, you won't have to remember to turn it off in there.

In the web.config you can modify the asp.page section:

<asp:Page EnableViewStateMac="False" />

And this will turn it off for the entire site.

http://msdn.microsoft.com/en-us/library/system.web.ui.page.enableviewstatemac.aspx

Zhaph - Ben Duguid