title: Parsing JSON data via a POST request in JS and C#
body: <p>I'm using C# as my back end and want to make a JSON object/string request to my back end of C#.</p>
  
  <p>I have C# code like so (for GET requests):</p>
  
  <pre><code>[WebMethod]
  [ScriptMethod(UseHttpGet = true,
  ResponseFormat = ResponseFormat.Json, XmlSerializeString = false)]
  public static string GetOptionsServiceHttpGet(string variableId)
  {
      // Do database stuff
  
      string retval = Serialize stuff/function goes here
  
      return retval;
  }
  </code></pre>
  
  <p>The javascript front end code is this:</p>
  
  <pre><code>function Variable_Proxy() { }
  
         Variable_Proxy.GetVarOptionsHttpGet =
         function (variableId, successCallback, failureCallback) {
             $.ajax({
                 type: "GET",
                 contentType: "application/json; charset=utf-8",
                 url: "file.aspx/GetOptionsServiceHttpGet?varId=\"" + variableId + "\",
                 success: function (data) { successCallback(data); },
                 error: function (data) { failureCallback(data); }
             });
         }
  </code></pre>
  
  <p>How do I do a post or whatever to get my JSON object to my back end on click?</p>