title: How to POST two variable using ajax for save the data
body: <p>I want to POST two variables. One is a JSON string and another one is a textbox value I am using C# for SQL server connection. Can anyone please check what is wrong in my code.</p>
  
  <pre><code>var myjsonstring = JSON.stringify(myjson);
  var filename = $("#fname").val();
  
  $.ajax({
      type: "POST",
      url: "http://localhost/name/Service/SaveData",
      dataType: "json",
      contentType: 'application/json',
      data: JSON.stringify({
          jsonobject: myjsonstring,filename
      }),
      success: function (data) {
          alert('Success');
  
      },
      error: function () {
          alert('Error');
  }
  });
  </code></pre>