Skip to content

Instantly share code, notes, and snippets.

@nozzlegear
Created December 17, 2014 02:37
Show Gist options
  • Select an option

  • Save nozzlegear/e4428241629cde12ad4e to your computer and use it in GitHub Desktop.

Select an option

Save nozzlegear/e4428241629cde12ad4e to your computer and use it in GitHub Desktop.
Using the ValidateHeaderAntiForgeryToken attribute
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
namespace MyNamespace.Controllers{
public class SomePathController : Controller{
// POST: /SomePath/DoSomething
[HttpPost, ValidateHeaderAntiForgeryToken]
public ActionResult DoSomething(string FirstName, string LastName){
// Do something here
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment