title: How to populate an array in javascript using data sent through Model List
body: <p>I have a list in my model, EmployeeList</p>
  
  <p>In my View I want to to populate an array from EmployeeList(from Model) and use it as autocomplete for tags.  It seems that the array isn`t being poplulated from the List nor is the autocomplete working.  Help please.</p>
  
  <p>The code in the View is as follows:</p>
  
  <pre><code> &lt;title&gt;jQuery Autocomplete example&lt;/title&gt;
  &lt;script type="text/javascript" src="../../scripts/jquery-1.2.6.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="../../scripts/jquery.autocomplete.js"&gt;&lt;/script&gt;
  
  &lt;!-- Listing 14.3 --&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function() {
  
      var employeeList = '@Model.EmployeeLis.toArray();'
  
  
          $("#tags").autocomplete({
              source: employeeList
  
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>
  </p>
  
  <pre><code> &lt;h1&gt;Type your name here&lt;/h1&gt;
  &lt;%= Html.TextBox("tags") %&gt;
  </code></pre>
  
  <p>
  </p>