title: .NET MVC posting multiple parameters to controller using ajax
body: <p>I know this question has been asked many times, I relly tried to follow many examples but every time, I fail for an unknown reason. So I'm going to show you my example a (very simple one) and I need someone to tell me what did I do wrong.  </p>
  
  <p>Starting with the controller (its name is Recherche) method:</p>
  
  <pre><code>public int getNote(string a,string b)
  {
      if(string.IsNullOrEmpty(a))
          return 1;
      else return 0;
  }
  </code></pre>
  
  <p>As you can see I didn't use the variable b, but who cares it's just an example.  </p>
  
  <p>Now for the ajax method:</p>
  
  <pre><code>$.ajax({
              type: "POST",
              url: "/Recherche/getNote",
              coententType: 'application/json',
              dataType: 'json',
              data:JSON.stringify({a:"a",b:"b"}),
              success: successFunc,
          });
  
          function successFunc(data) {
              document.getElementById('note').innerHTML = data;}
  </code></pre>