title: Set AntiForgeryToken for redirect to HttpGet method in C#
body: <p>I want to check for CSRF in my webapp using the [ValidateAntiForgeryToken] attribute. The thing is, I have a GET method that changes data, so it should actually be a POST. But aside from a submit to this action method in the corresponding form, there are multiple redirects to this method, so I can't change it to a POST method. As far as I know, the [ValidateAntiForgeryToken] doesn't work for GET methods. Is there another way to validate a GET method or to redirect within the code to a POST method without using a form?</p>
  
  <p>My action method looks something like this:</p>
  
  <pre><code>public ActionResult SomeAction(SomeModel model)
  {
      // changes are made in database!!
  
      return View("View", model);
  }
  </code></pre>
  
  <p>And this action method is being redirected to from another action method:</p>
  
  <pre><code>public ActionResult SomeOtherAction()
  {
      return RedirectToAction("SomeAction", "Controller");
  }
  </code></pre>
  
  <p>I would like to change the first action to:</p>
  
  <pre><code>[HttpPost]
  [ValidateAntiForgeryToken]
  public ActionResult SomeAction(SomeModel model)
  {
      // changes are made in database!!
  
      return View("View", model);
  }
  </code></pre>
  
  <p>and add @Html.AntiForgeryToken in the corresponding view. But then the redirect in the second action won't work anymore. Does anyone know a way out of this?</p>