Kottan
Kottan

Reputation: 5056

ASP.NET Ajax Control Kit versus JQuery

During the last 2 years JQuery has become more and more popular. So do you think, it is now time to prefer JQuery to ASP.NET Ajax in ASP.NET projects with Ajax? Has the ASP.NET Ajax Control Kit a future in the ASP.NET world?

Upvotes: 5

Views: 1120

Answers (5)

Dave Ward
Dave Ward

Reputation: 60580

Short answer:

If your page/site isn't currently depending on the UpdatePanel or ACT controls, definitely use jQuery and jQuery UI for any new work. That's even Microsoft's own recommendation now.

Long answer:

It's important to be clear about terminology when dealing with this topic.

ASP.NET AJAX is part client-side, but also part server-side. System.Web.Extensions came from Atlas and was eventually integrated into ASP.NET 3.5. Even if you don't use a ScriptManager or MicrosoftAjax.js, the server-side portions of ASP.NET AJAX are still very useful for creating JSON-based server-side endpoints (and those may be called directly from jQuery, with no ScriptManager).

jQuery and MicrosoftAjax.js are somewhat similar, but both do things that the other doesn't. It's not strictly accurate to say that they compete with each other; they have different goals. If your application has any UpdatePanels, you have no choice but to include MicrosoftAjax.js (which is coming in automatically with the ScriptManager). jQuery and MicrosoftAjax.js do play nice together though, so you can still use jQuery's more powerful selectors, traversals, and animations in conjunction with UpdatePanels if you must.

The AJAX Control Toolkit (ACT) is a different project, entirely separate from ASP.NET AJAX. It most directly compares with jQuery UI, not jQuery core itself. Going forward, I think we'll see most of the client-side-only AJAX Control Toolkit controls refactored as jQuery plugins (that already happened late last year, but they were pulled).

Ultimately, it's best to favor jQuery or jQuery UI over MicrosoftAjax.js or the ACT if an equivalent solution exists in both. However, if you're tied to MicrosoftAjax.js with UpdatePanels or other existing code, don't be afraid to mix jQuery with that and transition to jQuery slowly. They work great together.

Upvotes: 3

Julien N
Julien N

Reputation: 3920

I think that ASP.NET Ajax Toolkit is using jQuery under the hood. (this is wrong).

You may use both. I guess it depends on what you prefer, because Ajax Toolkit provides controls that you can use server side, while jQuery will always be client side only.

So you'll probably use both : when a control exist in Ajax Toolkit and you need some server side properties / accessors, etc. use it, if you need some functionnalities that aren't provided by the Toolkit, use pure jQuery.

Microsoft is working with the jQuery community and submits some patches to them. So I guess they'll continue to maintain the Toolkit. Ajax Toolkit being only a layer over pure jQuery functions and providing server-side controls.

Update:
Interesting quotes from this blog:

However, with Visual Studio 2008 Service Pack 1, we also added support for the ever increasing popular jQuery library. That is, you can use jQuery along with ASP.NET and would also get intellisense for jQuery in Visual Studio 2008.

And :

For client side programming using JavaScript for implementing AJAX in ASP.NET, the recommendation is to use jQuery which will be shipped along with Visual Studio and provides intellisense as well.

For server side programming one you can use the server controls like UpdatePanel etc., and also the AJAX Control Toolkit which has close to 40 controls now.

Upvotes: 1

Marnix van Valen
Marnix van Valen

Reputation: 13673

ASP.NET Ajax and the ASP.NET Ajax toolkit are two separate things. The toolkit is a set of ASP.NET controls (and some other stuff). It's server side code and some javascript. ASP.NET Ajax is an application framework you can use to create and manage client side controls; it's Javascript. The ASP.NET Ajax toolkit is based on this framework.

jQuery and ASP.NET Ajax have some overlaps in functionality but they are by no means mutually exclusive. jQuery is mostly geared towards updating and manipulating markup. ASP.NET Ajax is geared towards providing an application framework.

Microsoft has recently decided not to compete with jQuery but invest in it because jQuery and ASP.NET Ajax work well together and complement each other. JQuery is actually shipped with Visual Studio.

So, to answer your first question, you should use the JavaScript lib best suited for the job, be that jQuery or ASP.NET Ajax.

Whether you want to use the Toolkit, that depends on how much you like wrestling with ASP.NET controls. If you're into lean-and-mean coding like ASP>NET MVC, I'd drop it like a hot potato. If your in a traditional WebForms project, the toolkit is probably as good as it's going to get.

Upvotes: 1

rebelliard
rebelliard

Reputation: 9611

In my opinion, jQuery is leaps and bounds better than the Ajax Control Toolkit. The main reason for me is the great back-up the community has given it. Not only is the jQuery documentation on the web better, but by jQuery not being a .NET-centric framework, the community is bigger, meaning that anyone from a Ruby on Rails developer to a PHP developer can help you with your code just as good as a .NET developer, which would be obviously harder to find.

Other than that, I've had better performance than the Toolkit, and I find it a whole lot easier to write against and customize. And you got to love jQuery UI.

By the way, be aware that by simply enabling the ScriptManager on your ASPX page, your loading a bunch of scripts which add extra load to your page. Something to have in mind before mixing up jQuery and the Toolkit.

Upvotes: 1

CJM
CJM

Reputation: 12016

jQuery is the more popular, mainly because it is platform independent, but it's a good system in it's own right.

I don't think that there is anything wrong with ASP.NET AJAX for those developing on Microsoft platforms either.

I've used both, but I'm erring towards jQuery now, mainly because of the resources and samples available out there.

Does that mean the MS offering is doomed? Not yet. It will exist for as long as a certain number of people are using it, but I think it will always play second-fiddle to jQuery.

If you are an ASP.NET-only developer, have a peek at both and use whichever suits you best. If you develop on different platforms, then settling on jQuery might be more advisable.

PS. there are other cross-platform AJAX frameworks out there also...

Upvotes: 2

Related Questions