I have a list in my model, EmployeeList
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.
The code in the View is as follows:
<title>jQuery Autocomplete example</title>
<script type="text/javascript" src="../../scripts/jquery-1.2.6.js"></script>
<script type="text/javascript" src="../../scripts/jquery.autocomplete.js"></script>
<!-- Listing 14.3 -->
<script type="text/javascript">
$(document).ready(function() {
var employeeList = '@Model.EmployeeLis.toArray();'
$("#tags").autocomplete({
source: employeeList
});
});
</script>
<h1>Type your name here</h1>
<%= Html.TextBox("tags") %>