title: Invalid JSON primitive On Post
body: <p>I know this question has been asked multiple times in Stakoverflow.But none of the solution is helping me .Can anyone tell me what had been done wrong </p>
  
  <p>I have a Controller Action as below</p>
  
  <pre><code>&lt;HttpPost()&gt;
      Function WFUserEdited(ByVal userdetails As userdetails) As ActionResult
              Return View()
      End Function
  </code></pre>
  
  <p>And My Viewmodel is like below</p>
  
  <pre><code>Public Class userdetails
      Public Property Username As String
      Public Property Password As String
      Public Property Fullname As String
      Public Property Location As String
      Public Property Appcode As String
      Public Property Userlevel As String
  End Class
  </code></pre>
  
  <p>And My Jquery Ajax call is like below</p>
  
  <pre><code> $("#btnSubmit").click(function () {
                  var q = validate();
                  if (q = true) {
                      var userdetails = {};
                      userdetails.UserName = $('#txtusername').val().toString();
                      userdetails.Password = $('#txtPassword').val().toString();
                      userdetails.Fullname = $('#txtfullName').val().toString();
                      userdetails.Location = $('#txt_location').val().toString();
                      userdetails.Appcode = $("#drp_appcode").chosen().val().toString();
                      userdetails.Userlevel = $("#drp_userlevel").chosen().val().toString();
                      userdetails = JSON.stringify(userdetails);
                      var url = '@Url.Action("WFUserEdited", "WFUser")';
  
                      $.ajax({
                          url: url,
                          type: 'POST',
                          traditional: false,
                          contentType: "application/json; charset=utf-8",
                          dataType: 'json',
                          data: { "userdetails": userdetails },
                          success: function (data) {
                          },
                          error: function (data) {
                          }
                      });
                  }
              });
          });
  </code></pre>
  
  <p>And at The Beginexecutecore iam getting the below exception </p>
  
  <pre><code> Protected Overrides Function BeginExecuteCore(callback As AsyncCallback, state As Object) As IAsyncResult
          Try
              ViewBag.UserImage = "http://_layouts/15/CaptarisWFTasksWebPart/EmployeeImages/sree.jpg"
  
          Catch generatedExceptionName As Exception
              Return MyBase.BeginExecuteCore(callback, state)
          End Try
          Return MyBase.BeginExecuteCore(callback, state)
      End Function
  </code></pre>
  
  <p>An exception of type 'System.ArgumentException' occurred in System.Web.Mvc.dll but was not handled in user code
  Additional information: Invalid JSON primitive: userdetails.</p>