title: ValidateAntiForgeryToken with SPA architecture
body: <p>I am trying to set Register and Login for Hot Towel SPA applicantion. I have created SimpleMembershipFilters and ValidateHttpAntiForgeryTokenAttribute based on the <a href="http://www.asp.net/single-page-application">asp.net single page application template</a>.</p>
  
  <p>How do you get the </p>
  
  <pre><code> @Html.AntiForgeryToken()
  </code></pre>
  
  <p>code to work in the Durandal SPA pattern.</p>
  
  <p>Currently I have a <strong>register.html</strong></p>
  
  <pre><code>&lt;section&gt;
      &lt;h2 data-bind="text: title"&gt;&lt;/h2&gt;
  
      &lt;label&gt;Firstname:&lt;/label&gt;&lt;input data-bind="value: firstName" type="text"  /&gt;
      &lt;label&gt;Lastname:&lt;/label&gt;&lt;input data-bind="value: lastName" type="text"  /&gt;
      &lt;label&gt;Email:&lt;/label&gt;&lt;input data-bind="value: emailAddress" type="text"  /&gt;
      &lt;label&gt;Company:&lt;/label&gt;&lt;input data-bind="value: company" type="text"  /&gt;
      &lt;br /&gt;
      &lt;label&gt;Password:&lt;/label&gt;&lt;input data-bind="value: password1" type="password" /&gt;
      &lt;label&gt;Re-Enter Password:&lt;/label&gt;&lt;input data-bind="value: password2" type="password" /&gt;
      &lt;input type="button" value="Register" data-bind="click: registerUser" class="btn" /&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p><strong>register.js</strong>:</p>
  
  <pre><code>define(['services/logger'], function (logger) {
      var vm = {
          activate: activate,
          title: 'Register',
          firstName: ko.observable(),
          lastName: ko.observable(),
          emailAddress: ko.observable(),
          company: ko.observable(),
          password1: ko.observable(),
          password2: ko.observable(),
          registerUser: function () {
              var d = {
                  'FirstName': vm.firstName,
                  'LastName': vm.lastName,
                  'EmailAddress': vm.emailAddress,
                  'Company': vm.company,
                  'Password': vm.password1,
                  'ConfirmPassword': vm.password2
              };
              $.ajax({
                  url: 'Account/JsonRegister',
                  type: "POST",
                  data: d ,
                  success: function (result) {
                  },
                  error: function (result) {
                  }
              });
          },
      };
  
  
      return vm;
  
      //#region Internal Methods
      function activate() {
          logger.log('Login Screen Activated', null, 'login', true);
          return true;
      }
      //#endregion
  });
  </code></pre>
  
  <p>In the $ajax call how do I pass the AntiForgeryToken? Also how do I create the token as well?</p>