title: Getting invalid json primitive error in jquery-ajax
body: <p>I am using Jquery Ajax for calling the methods in controller, but i am always getting  invalid json primitive error.</p>
  
  <p><strong>Below is the Code.</strong></p>
  
  <p><strong>Client side Code</strong></p>
  
  <pre><code>$("#something &gt;li").each(function () {
                      widgetsobj.push({
                      WidgetId: $(this).attr("dbid"),
                      ColumnNumber: 2,
                      RowNumber: 3,
                      WidgetType: "Graph",
                      WidgetName: "ddd",
                      PageName : "Page1"
                  });
              });
  
   $.ajax({
              url: "/Home/ABC",
              dataType: "json",
              type: "POST",
              contentType: "application/json; charset=utf-8",
              data: { pagename1: pagename, widgetsobj1: JSON.stringify(widgetsobj) },
              success: function (data) {
                  alert("ss");
              },
              error: function (data) {
                  debugger;
              }
          });
  </code></pre>
  
  <p><strong>at controller</strong> </p>
  
  <pre><code>[HttpPost, ValidateInput(false)]
   public JsonResult ABC(string pagename1, List&lt;XYZ&gt; widgetsobj1)
  {
  
    // do something
  }
  </code></pre>
  
  <p>Note XYZ is object with below properties.</p>
  
  <ul>
  <li><p>WidgetId </p></li>
  <li><p>ColumnNumber  </p></li>
  <li><p>RowNumber   </p></li>
  <li><p>WidgetType   </p></li>
  <li><p>WidgetName   </p></li>
  <li><p>PageName </p></li>
  </ul>
  
  <p>So please let me know where i am wrong.</p>