title: MVC autocomplete not working
body: <p>I know there are lot of posts out there but simply I can not figure out what I am doing wrong in autocomplete.</p>
  
  <p>I have a ProductController like</p>
  
  <pre><code>public JsonResult AutocompleteMethod(string searchstring) //searchString null here
          {
                Product ob=new Product();
                List&lt;Product&gt; newLst = ob.GetProducts();
                var suggestions = from s in newLst select s.productName ;
                var namelist = suggestions.Where(n=&gt;n.StartsWith(searchstring));
                return Json(namelist, JsonRequestBehavior.AllowGet);
           }
  </code></pre>
  
  <p>In view I have:</p>
  
  <pre><code>    &lt;p&gt;
          Find by name:&lt;%: Html.TextBox("Txt") %&gt;
      &lt;/p&gt;
  
       &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" /&gt;
       &lt;script src="http://code.jquery.com/jquery-1.8.3.js" type="text/javascript"&gt;&lt;/script&gt;
       &lt;script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js" type="text/javascript"&gt;&lt;/script&gt;
  
  
       &lt;script type="text/jscript"&gt;
           $(function () {
               debugger;
  
               $('#Txt').autocomplete({ source: '/Product/AutocompleteMethod' });
  
           });
       &lt;/script&gt;
  </code></pre>
  
  <p>But always <strong>SearchString</strong> is <code>NULL</code> in controller function.</p>
  
  <p>Can you figure out what is the mistake?</p>