Jquery autocomplete with variable as source from code behind

ieceetee

New Member
I got a list on the code behind with some random values. I want this list in the auto complete. I succeeded getting the list to javascript. But when I want to set this variable that contains a list to the source of the auto correct I get this error message:"Object doesn't support this property or method"How can I set the variable as source for the auto correct?\[code\] <script type="text/javascript"> var publicationTable = <%= getJson() %>; alert(publicationTable); $("#txtrandomNumberFilter").autocomplete({ source : publicationTable});</script>\[/code\]C# code behind: (the list gets filled from a database +/- 200 items)\[code\]public string getJson() { return (new JavaScriptSerializer()).Serialize(randomList); }\[/code\]This is what I get from the alert:
dO8m5.jpg
 
Back
Top