title: How to get JSON data that is sent by AJAX in ASP C#?
body: <p>I am very new to these jquery,JSON,AJAX &amp; asp C# so I really dont know the syntax to receive the JSON data that I sent from AJAX.</p>
  
  <p>Heres my jquery</p>
  
  <pre><code>var name = $('#username').val();
  var pass = $('#password').val();
  var data = { name: $('#username').val(), pass: $('#password').val() };
  var data2 = JSON.stringify(data)
  
  $.ajax({
      type: "POST",
      url: "auth.aspx",
      data: { "input": data2 },
      success: function (response) {
          alert(response);
      },
      failure: function (response) {
          alert("failed");
      }
  });  
  </code></pre>
  
  <p>and heres my C# </p>
  
  <pre><code>var name = Request.Form["input"];
  </code></pre>
  
  <p>I just want to send the data in JSON and read the JSON data in C# but somethings wrong and I cant read the JSON data</p>
  
  <p>if I change the </p>
  
  <pre><code>data: { "input": data2 },
  </code></pre>
  
  <p>into </p>
  
  <pre><code>data: { "name": name, "pass": pass },
  </code></pre>
  
  <p>I can just read it by using </p>
  
  <pre><code>string name = Request.Form["name"];
  string pass = Request.Form["pass"];
  </code></pre>
  
  <p>But Im guessing I cant use the same technique for JSON data?</p>