title: Passing data with jquery ajax
body: <p>I always get the 'error' alert, and I can't figure out what's wrong. I'm just trying to get back the string ("testexpression") that I send. It has to be something with the data part, because without a parameter it works.</p>
  
  <p>Here's the jquery part:</p>
  
  <pre><code>&lt;script&gt;
  
  $("#meaning").blur(function () {
  
      $.ajax({ 
          type: "POST",
          url: '/GetMeaning/',
          data: {"expression" : "testexpression"},
          contentType: "application/json; charset=utf-8",
          dataType: "json",
          success: successFunc,
          error: errorFunc
      });
  
      function successFunc(data, status) {
          $("#dictionaryDropDown").html(data);
      }
  
      function errorFunc() {
          alert('error');
      }
  })
  &lt;/script&gt;
  </code></pre>
  
  <p>And this is the controller:</p>
  
  <pre><code>    public class GetMeaningController : Controller
  {
      //
      // GET: /GetMeaning/
  
      [HttpGet]
      public ActionResult Index()
      {
          return View();
      }
  
      [HttpPost]
      public ActionResult Index(string expression)
      {
  
          return Json(expression, JsonRequestBehavior.AllowGet);
  
      }
  
  }
  </code></pre>
  
  <p>(update: the type is post, I was just trying it out with get as well, and I left it in)</p>