title: Validation of viewstate MAC failed while submit a form on page load
body: <p>I have a sample page called Redirect.aspx with following content;</p>
  
  <pre><code>&lt;body onload="document.forms.container.submit()"&gt;
      &lt;form id="container" runat="server" method="post" name="container"&gt;
          &lt;input type="hidden" value="&lt;%=Request["APP_ID"]%&gt;" name="APP_ID" /&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>the <code>Page_Load</code> method is following:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {            
      container.Action = Configuration.Instance.PageToRedirect;
  }
  </code></pre>
  
  <p>To this Redirect.aspx page, I'm directed from some external page. In the request context, I have APP_ID key, which is passed from this external page. Next, I want to pass this APP_ID value using POST to some other page, which is defined in the configuration. Unfortunately, I'm getting such error while redirecting:</p>
  
  <blockquote>
    <p>Validation of viewstate MAC failed. If
    this application is hosted by a Web
    Farm or cluster, ensure that
     configuration specifies
    the same validationKey and validation
    algorithm. AutoGenerate cannot be used
    in a cluster.</p>
  </blockquote>
  
  <p>I don't want to disable view state validation (<code>&lt;pages enableViewStateMac="false"&gt;</code>) because this is not the "solution" I want to apply.</p>
  
  <p>Besides I don't understand why I'm getting such an error. Can someone get me through this ? Is there any other way to automatically submit a form on <code>Page_Load</code> event ?</p>
  
  <p>Regards</p>