title: jQuery UI Autocomplete with ASP MVC
body: <p>I'm trying to get the jQuery Automcomplete thing to work, but it wont do as i want :P
  This is my code:</p>
  
  <p>JavaScript:</p>
  
  <pre><code>        $("#CustomerID").autocomplete({
              source: function(request, response) {
                  $.ajax({
                      type: "POST",
                      url: "/customer/search",
                      dataType: "json",
                      data: {
                          term: request.term
                      },
                      error: function(xhr, textStatus, errorThrown) {
                          alert('Error: ' + xhr.responseText);
                      },
                      success: function(data) {
                          response($.map(data, function(c) {
                              return {
                                  label: c.Company,
                                  value: c.ID
                              }
                          }));
                      }
                  });
              },
              minLength: 2,
              select: function(event, ui) {
                  alert('Select');
              }
          });
  </code></pre>
  
  <p>ASP MVC:</p>
  
  <pre><code>    [AcceptVerbs(HttpVerbs.Post)]
      public JsonResult Search(string term)
      {
          if (term == null)
              term = "";
  
          List&lt;JSON_Customer&gt; customers = repCustomer.FindCustomers(term).ToList();
          return Json(customers);
      }
  
      public class JSON_Customer
      {
          public int ID { get; set; }
          public string Company { get; set; }
      }
  
      public IQueryable&lt;JSON_Customer&gt; FindCustomers(string searchText)
      {
          return from c in _db.Customers
                 where c.Company.Contains(searchText)
                 orderby c.Company
                 select new JSON_Customer
                 {
                     ID = c.ID,
                     Company = c.Company
                 };
      }
  </code></pre>
  
  <p>I get the request from <code>$.ajax</code> and I return the correct list of customers according to the search term. And the <code>success</code> method is invoked. I can see that <code>data</code> has a <code>[object Object]</code> value but what do I do next? No customers drops down in my list. I'm using the <code>response($.map...</code> code from the <a href="http://jqueryui.com/demos/autocomplete/#remote-jsonp" rel="nofollow noreferrer">http://jqueryui.com/demos/autocomplete/#remote-jsonp</a> but it just wont work.</p>
  
  <p>Anyone know why?</p>