Posted by Alec on Mon, 08 Mar 2010, in ASP.NET C# Sharepoint
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.