title: JQuery autocomplete + Asp.net MVC
body: <p>I'm using the JQuery Autocomplete Plugin in my Asp.net MVC project. So far, I return a List of Strings from my search method and these strings are displayed correctly.</p>
  
  <p>In my View:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(function () {
          $("#search").autocomplete({
              source: '&lt;%: Url.Action("Search") %&gt;',
              minLength: 1
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public JsonResult Search(string term)
  {
    //search Code here ...  
    var dt = ....;
    var result = new List&lt;string&gt;();
    //search Code returns a DataTable, which I convert into a List&lt;string&gt;
  
      for (int i = 0; i &lt; dt.Rows.Count; i++)
      {
        result.Add(...);
      }
  
    //return List&lt;string&gt; to the autocomplete plugin
    return Json(result, JsonRequestBehavior.AllowGet);
  }
  </code></pre>
  
  <p>I wonder if it's possible to return a DataTable object and display the DataTable in a HTML table. Or is it possible to return a HTML table? Has anyone tried something like this?</p>
  
  <p>Thanks a lot</p>
  
  <p>Jaspis</p>