Wednesday, March 28, 2012

ASP.NET AJAX Extensions vs. Professional AJAX

Hi,

I'm curious as to why Web Services and SOAP were chosen as the transport mechanisms for the ASP.NET AJAX Extensions instead of Attributes and JSON.

In Professional AJAX, you add a few lines to your web.config, apply the AjaxPro.AjaxMethod attribute to the class method you want to call from javascript, and register the class in the code behind page usingAjaxPro.Utility.RegisterTypeForAjax(). Do the ASP.NET AJAX Extensions have something similar to this?

Also,if I build equivalent codein two ASP.NET apps, one using Professional AJAX and one using the ASP.NET AJAX Extensions, the ASP.NET app using Professional AJAX, which uses JSON, sends far fewer KB back and forth.

Professional AJAX:http://www.codeplex.com/AjaxPro

thanks,

Tom

tcboring@.work:

Hi,

I'm curious as to why Web Services and SOAP were chosen as the transport mechanisms for the ASP.NET AJAX Extensions instead of Attributes and JSON.

Why do you say this? By default, Web Services used by the ASP.NET Ajax frameworkdo use JSON for data transfer.

http://msdn.microsoft.com/msdnmag/issues/07/01/ExtremeASPNET/default.aspx
http://msdn.microsoft.com/msdnmag/issues/07/02/CuttingEdge/default.aspx


tcboring@.work:

In Professional AJAX, you add a few lines to your web.config, apply the AjaxPro.AjaxMethod attribute to the class method you want to call from javascript, and register the class in the code behind page usingAjaxPro.Utility.RegisterTypeForAjax(). Do the ASP.NET AJAX Extensions have something similar to this?

The way Professional AJAX works is very similar to ASP.NET AJAX page methods.


Mike,

Thanks for the links--I just finished reading the material they point at. I honestly had no idea that JSON was used, because when I look at the HTTP traffic (using Fiddler) generated while using the ASP.NET AJAX Extensions (AAE) it all looks like good old XML to me--besides the HTML rendered by my aspx pages. I've just downloaded the latest version of AAE, and I'll take a look again--the last time I played with AAE was back in March when I decided to use the Professional AJAX library instead.

thanks,

Tom


gt1329a:

tcboring@.work:

In Professional AJAX, you add a few lines to your web.config, apply the AjaxPro.AjaxMethod attribute to the class method you want to call from javascript, and register the class in the code behind page usingAjaxPro.Utility.RegisterTypeForAjax(). Do the ASP.NET AJAX Extensions have something similar to this?

The way Professional AJAX works is very similar to ASP.NET AJAX page methods.

Got any links to back that up?


Just my opinion, having watched both of their request/response behaviors in FireBug.

Here's an example of a page method in action: http://encosia.com/index.php/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/

Certainly no SOAP there.


gt1329a:

Just my opinion, having watched both of their request/response behaviors in FireBug.

Here's an example of a page method in action: http://encosia.com/index.php/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/

Certainly no SOAP there.

Okay, that's what I was missing--I didn't come across Page Methods. Like you noted in your article, the amount of extra information that's added to the data you really want is silly. It's exactly why I chose Professional AJAX.NET over Microsoft's framework.

Still though, the style of solution that Professional AJAX.NET gives just feels more...streamlined.


The counterpoint to something like AJAX Pro is what would you do if you needed to create an AJAX-ified GridView using it? With ASP.NET AJAX, you have the flexibility to use light weight techniques when appropriate, but still fall back to partial postbacks when they are necessary.

gt1329a:

The counterpoint to something like AJAX Pro is what would you do if you needed to create an AJAX-ified GridView using it? With ASP.NET AJAX, you have the flexibility to use light weight techniques when appropriate, but still fall back to partial postbacks when they are necessary.

Yeah, that's the main weakness of AJAX.NET Pro right now: you can only work with HTML controls. Now that i know about page methods, I'm going to give the AAE another chance.


I tried both solutions and somehow I can't run AJAX Pro (namespace not defined error) and Extensions don't allow me to execute non static method.


If you can't get it done in a static method, you can always turn to a full web service call.

No comments:

Post a Comment