jQuery 1.3.2, ASP.NET 2.0. Making an AJAX call to a PageMethod (WebMethod) returns the full/whole page instead of just the response. A breakpoint on the page method shows it's never getting hit. I have the [WebMethod] attribute on my method, and it is public static, returns string and accepts no params. I even tried adding [ScriptService] at the top of my class to see if it helped, but it did not.
I have seen this post Jquery AJAX with ASP.NET WebMethod Returning Entire Page which had my same symptoms, but I am still having a problem. I read http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/ and I feel like I'm following this to the T, but still no luck.
The jQuery call I'm making is:
contentType: 'application/json; charset=utf-8',
Server ASP.NET Development Server/188.8.131.52
Date Tue, 24 Feb 2009 18:58:27 GMT
Content-Type text/html; charset=utf-8
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:184.108.40.206) Gecko/2009011913 Firefox/3.0.6
Content-Type application/json; charset=utf-8
Do you know that Page Methods are working properly? If you use the the ScriptManager do they work?
It sounds like you might be missing a web.config entry. Specifically the HttpModules section.