I ahve been practicing jQuery.ajax() recently. I have started to learn to call .Net web-services qith jQuery.ajax().
Now I am considering if I will use only jQuery.ajax() calls to some service methods on the server; is it still meaningfull to have .Net Web-Services or I should go with .ashx handlers instead?
Thanks!
Two quotes from the ASP.NET forums:
Unless it's an extremely high load situation, you'll find that all three perform nearly identically. The performance of your code inside the handler/service is going to be the limiting factor.
For simple AJAX calls that are only intended to be exposed to the browser, I don't think WCF justifies its added complexity. It's great for some things, but I have a hard time recommending it for this.
Between ASMX and HttpHandler, I go with ASMX every time. An HttpHandler is probably negligibly faster, but an ASMX "ScriptService" makes JSON serialization and deserialization of complex types transparent, which is immensely useful.
Here's another option:
If you have some methods you want to run (and you like JQuery)... I suggest looking at this:
http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/
and related articles. Works beautiful. Very efficient as far as bandwith goes. They also have an article on querying .asmx services.
There is no messing around with the bloated size of ASP.NET's innate AJAX. Since AJAX out of the box can be very bloated. Plus it's very easy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With