title: converting object variable to json string for asp.net page method
body: <p>This is probably a very simple task to perform but I'm taking the risk to ask anyway.</p>
  
  <p>I have an object variable that looks like this:</p>
  
  <pre><code>var MyObj = {"Param1": "Default",
               "Param2": "test",
               "Param3": 3 };
  </code></pre>
  
  <p>I'm using ASP.net and I'm looking to pass this object to a page method via jquery.</p>
  
  <p>So far, I have this javascript code:</p>
  
  <pre><code>function LoadObject () {
  
    var TheObject = MyObj.toString();
  
    $.ajax({
      type: "POST",
      url: "../Pages/TestPage.aspx/GetCount",
      data: TheObject,
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: successFn,
      error: errorFn
      });
  };
  </code></pre>
  
  <p>I have a page method set up in the .cs file and I put a breakpoint in it but it never gets there; nothing happens.</p>
  
  <p>Please let me know what changes I need to make to get this to work.
  Thanks.</p>