title: Postback not working with ASP.NET Routing (Validation of viewstate MAC failed)
body: <p>I'm using the ASP.NET 3.5 SP1 System.Web.Routing with classic WebForms, as described in <a href="http://chriscavanagh.wordpress.com/2008/04/25/systemwebrouting-with-webforms-sample/" rel="noreferrer">http://chriscavanagh.wordpress.com/2008/04/25/systemwebrouting-with-webforms-sample/</a></p>
  
  <p><strong>All works fine</strong>, I have custom SEO urls and even the postback works. <strong>But there is a case where the postback always fails</strong> and I get a:</p>
  
  <p><em>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.</em></p>
  
  <p>Here is the scenario to reproduce the error:</p>
  
  <ol>
  <li>Create a standard webform mypage.aspx with a button</li>
  <li>Create a Route that maps "a/b/{id}" to "~/mypage.aspx"</li>
  <li>When you execute the site, you can navigate <a href="http://localhost:XXXX/a/b/something" rel="noreferrer">http://localhost:XXXX/a/b/something</a> the page works. But when you press the button you get the error. The error doen't happen when the Route is just "a/{id}". </li>
  </ol>
  
  <p>It seems to be related to the number of sub-paths in the url. If there are at least 2 sub-paths the viewstate validation fails.</p>
  
  <p>You get the error even with EnableViewStateMac="false".</p>
  
  <p>Any ideas? Is it a bug?</p>
  
  <p>Thanks</p>