title: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type
body: <p>Here's a constant class I use to invoke some helpers:</p>
  
  <pre><code>public static class SecurityHelpers
  {
      public static string AntiforgeryTokenSalt = "tokenFooYouTolkienBladeRunner";         
  }
  </code></pre>
  
  <p>And here's how I invoke it in one of my forms in my MVC3 web application:</p>
  
  <pre><code>@using (Html.BeginForm("Index", "Checkout", FormMethod.Post))
  {   
      &lt;input type="hidden" name="amount" value="@Model.PackageCost"/&gt;
      &lt;input type="hidden" name="currency" value="$"/&gt;
      &lt;input type="hidden" name="itemdescription" value="@Model.PackageDescriptor"/&gt;
      &lt;input type="hidden" name="type" value="digital"/&gt;
      @Html.AntiForgeryToken(App.WebUI.Helpers.SecurityHelpers.AntiforgeryTokenSalt)
  
      &lt;input type="submit" value="Confirmar" class="btn primary frmsubmit" /&gt;
  }
  </code></pre>
  
  <p>And in my Controller:</p>
  
  <pre><code>[HttpPost]
  [ValidateAntiForgeryToken(Salt = SecurityHelpers.AntiforgeryTokenSalt)]
  public ActionResult Index(decimal amount, string currency, string itemDescription, string type)
  {
      if (!User.Identity.IsAuthenticated) return RedirectToAction("LogOn", "Account");
  }
  </code></pre>
  
  <p>The error is fired in my Controller, it says:</p>
  
  <blockquote>
    <p>An attribute argument must be a constant expression, typeof expression
    or array creation expression of an attribute parameter type</p>
  </blockquote>
  
  <p>Any ideas why this isn't working? The <code>Salt</code> attribute of the ValidateAntiForgeryToken decorator is a string and my constant is also a string, so I'm confused.</p>