Back to previous

Auto Complete returns giant list of undefined

Aaron was creating a custom web service to be used by web parts in Sharepoint, but then there was a problem of a giant list of "undefined" values returning. Done a lot of research and later this brilliant post directed us to the right place.

It turns out that we have to add

[System.Web.Script.Services.ScriptService]

to the beginning of our web methods. Essentially what they do is allow for the AJAX (any JavaScript really) to call this web service and web method. And make sure you add System.Web.Extensions to your solution's reference as that is where System.Web.Script is from.

ShareThis

If you think this post is useful, please recommend me at the bottom of the page. ;)

Discussion