Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
So what's the story? No web farm or cluster here, just the simple visual studio IIS-lite process running. I started trying things like setting EnableViewState to false everywhere but to no avail.
My ultimate problem was I was mixing pure HTML and ASP.NET. My form looked like
<form id="form1" runat="server" action="publishcomplete.aspx"><asp:Button ID="ButtonPublish" runat="server" Text="Publish data" /></form>
Google failed me and I was too lazy to look at previous solutions to see how I'd done it before. Emasculated, I asked for help and my coworker, being the awesome one he is, gave me the appropriate level of grief along with the solution. The action is old school and doesn't work mixed with ASP.NET controls. Instead, move the action to the appropriate button and set the PostBackUrl property.
<form id="form1" runat="server"><asp:Button ID="ButtonPublish" runat="server" Text="Publish data" PostBackUrl="~/PublishComplete.aspx"/></form>
Problem solved and now on to better things
No comments:
Post a Comment