ASP.NET page methods vs web service ASP.NET page methods vs web service asp.net asp.net

ASP.NET page methods vs web service


You can call PageMethods and Web Services without needing a ScriptManager control (which generates the JavaScript proxy objects that allow you to use familiar syntax to call web services and page methods).

Article on using jQuery to directly call ASP.NET AJAX page methods

Article on using jQuery to Consume ASP.NET JSON Web Services

Here's an MSDN article from 2007 on Web Services and Page Methods. Looking briefly through it, it seems to still be relevant to how they work / what you need to do to get them to work today.

Performance wise:

You might expect page methods to offer better performance than Web services. After all, to resolve Web service calls, the ASP.NET runtime has to parse SOAP packets. This, however, isn't exactly true. ASP.NET AJAX installs a tailor-made HTTP handler (see Figure 3) that intercepts all ASMX requests. Requests with a /js suffix are processed differently, working directly with the JSON payload and Web service method. As a result, no SOAP is involved whatsoever and the body of the request simply contains the JSON stream of input arguments. For non-AJAX requests, the new HTTP handler just delegates the call back to the original ASP.NET handler that understands SOAP.

In response to the Page Lifecycle, Page Methods do not go through the server-side Page LifeCycle (there is also a client-side Page Lifecycle too).