title: jQuery autocomplete ASP.Net not working
body: <p>I have the following code in controller:</p>
  
  <pre><code>public JsonResult FindProduct(string searchString)
  {
          var productsName = from c in db.Products
                             where c.ProductName.Contains(searchString)
                         select new { value = c.Barcode, label = c.ProductName };
  
          return this.Json(productsName, JsonRequestBehavior.AllowGet);
  }
  </code></pre>
  
  <p>And the following code in my View:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $("#productName").autocomplete({
              source: '&lt;%= Url.Action("FindProduct") %&gt;',
              select: function (event, ui) {
                  var prodBarcode = ui.item.value;
                  $("#productName").val(ui.item.label);
                  $("#productBarcode").val(ui.item.value);
                  return false;
              }
          });
      });
  &lt;/script&gt;
  
   &lt;div class="ui-widget"&gt;&lt;input type="text" name="productName" id="productName" /&gt;&lt;/div&gt;
  </code></pre>
  
  <p>For some reason the FindProduct(string searchString) is never called. And the autocomplete is not working. Do I need something else in my script?</p>