i have an asp.net mvc4 application razor, in which i'd like to add the auto-complétion features, i added a sample table availableTags with différents values and it works, but when i try an ArrayList to a javascript table:
@{
ArrayList elements = new ArrayList();
elements=(ArrayList)Session["elements"];
}
<script>
$(function () {
var champ = "@elements";
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$("#tags").autocomplete({
source: champ
});
});
</script>
it fails!!! What the reason of this problem? How can i fix it?