Remote Calls via Page Methods
As we've seen, Web and WCF services are simple and effective ways of implementing a server API. When the ASP.NET AJAX runtime engine has generated the proxy class, you're pretty much done and can start calling methods as if they were local to the client. Web and WCF services, though, are not free of issues. They require an extra layer of code and additional files or assembly references to be added to the project. Is this a big source of concern for you? If so, consider that you have an alternative—page methods.
Introducing Page Methods
Page methods are simply public, static methods exposed by the code-behind class of a given page and decorated with the WebMethod attribute. The runtime engine for page methods and AJAX-enabled ...
Get Programming Microsoft® ASP.NET 3.5 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.