Hint: Components that use Web Services with ASP.NET AJAX v1.0 Beta
Oh, something I forgot to put in the migration guide(s).
If you're calling any web service methods from client script, this has changes a little bit.
You now need to decorate those web services with [ScriptService]:
[Microsoft.Web.Script.Services.ScriptService]
public class MyWebService : WebService{
[WebMethod]
public void HelloWorld(){}
}
If you want to use Page Methods, they now need to be static, and have the ScriptMethod attribute:
public class MyPage : Page {
[WebMethod]
[Microsoft.Web.Script.Services.ScriptMethod]
public static string MyMethod() {
return "MyMethod Called";
}
}
UPDATE: One thing I forgot to mention is that your page method can't be in codebehind (e.g. the above won't work) due to a bug in this first AJAX release. You need to put the method into your ASPX Page like so:
<script runat="server">
[WebMethod]
[Microsoft.Web.Script.Services.ScriptMethod]
public static string MyMethod() {
return "MyMethod Called";
}
</script>
Accessing them via the Toolkit hasn't changed. All the components that have ServiceMethod/ServicePath properties, just leave ServicePath blank, and specify the method (e.g. "MyMethod" or "HelloWorld" from above).