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?
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.
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...
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.
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.
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.
Related
I know that the main draw to ASP.NET AJAX is the fact that you can build it nicely inside of Visual Studio and it is nice and easy. I am finding ASP.NET AJAX limiting, but I really like .NET and figure that a separate javascript library is probably the way to go for responsive apps that are easy to maintain.
I know that within the group (Dojo, ExtJS, MooTools...) there will be differences of opinion, but I am really curious to hear the results of effort and maintainability from people who have gone to or from the .NET component route. Thank you.
Edit:
This largely about ComponentOne's AJAX suite. I am new to ComponentOne, but have an opportunity to either embrace their library or push for something more appropriate. Our needs are customer facing and must be highly configurable. Many of our applications are reports while some are themselves application configuration tools.
Clay, if reporting is your focus then I would definitely go with ComponentOne. C1 has really powerful reporting tools in .NET and a pretty sweet report viewer in ASP.NET. C1's reporting tools can also use existing Crystal, SQL Server, and Access reports.
However, ComponentOne has been asking themselves the same question about server controls and JS libraries. So they built a completely stand-alone library called Wijmo. Wijmo is built on jQuery/jQuery UI and has over 30 widgets included in the kit. Wijmo even has rich data controls like grids and SVG charts that would would normally see in ASP.NET. It was originally built to be used in ASP.NET MVC as the UI layer. Here is a video on how to use Wijmo in MVC.
This same technology is being extended into the ComponentOne ASP.NET controls. So with choosing ComponentOne you will have both options based on the same client-side framework.Note that the Wijmo ASP.NET controls are still in the works and should be out in the summer of 2011.
My experience is that using ASP.NET AJAX controls, such as ComponentArt for example, tend to be limiting and force your design decisions. I have had much better success using pure JavaScript libraries for the UI Layer like jQuery/jQuery UI and ExtJS. Having the serverside render your JavaScript in the ASP.NET way gets complex when dealing with an advanced UI.
I like to get inspiration from using web applications that make good use of new technologies. This time I would like to check out ASP.NET based web applications that make heavy use of Ajax & Ajax Toolkit for line of business apps (data bound controls like grids). I checked out some apps at CodePlex but didn't see anything cool enough.
Any recommendations? Preferably an app with source.
I don't think your going to find what your looking for easily. The AJAX toolkit lacks the slickness of the plugins of jQuery and other popular frameworks. If you are looking to be impressed, you may want to look elsewhere than the toolkit.
I'm not sure what framework it's build on, but I have been very impressed by the UI of MailChimp lately. They nailed it, so easy to use and elegant.
I'm planning a ASP.NET project for which I'm going to use AJAX. I'm researching all the available technologies for doing so in the .NET world.
I need a solution that is well documented and stable.
The current solutions I've found are:
1. ASP.NET AJAX UpdatePanel
2. ASP.NET AJAX with Web Services + JQuery
3. JQuery + Http Handlers
In the second and third solutions the backend would only send JSON or XML messages to the client.
In my experience the best way to go is JQuery with WCF with JSON webservices.
The reason is:
ASP.NET ajax is gives you alot for free in terms of coding but is bloated from the start and needs to be stipted and slimed. On the other hand you have JQuery that you needs more development but is light weight. JQuery has a great plugin library as well.
XML is to slow, JSON is fast.
Thats how I would do it today.
All will work but I've had most performance and stability with using JQuery and a script service.
An update panel will work but as its designed to work in the general case it can be a little bloated if you aren't careful. One reason being is that it posts the viewstate back with each update.
I recommend you check out the site: encosia.com as it has a number of posts on how to use script services and page methods. Then you can make a more informed decision. I would say that I've not used page methods and probably won't but that's entirely for personal reasons.
One other thing to consider will be any mvc you may end up doing. The general consensus is that it's a whole lot easier with JQuery. Added to that Microsoft have officially adopted it and also provide intellisense in VS2008.
All compelling reasons to include at least some of it in your project. In mine I only use the built in ScriptManager when I absolutely have to.
HTH!
S
Due to a security requirement all browsers that will run a web application we need to create must have all client side scripting disabled. So that means no Javascript.
Unfortunately Web Forms make quite some use of Javascript. The login control works without Javascript, but a button does not (it calls the Javascript function __doPostback()).
So to make it work we'd need to program all the forms by hand (the ASP Classic, or PHP method). But I was wondering if there is a framework available for ASP.NET that offers the normal ASP.NET controls (treeview, gridview, etc) with all the functoinality they have, but that doesn't use Javascript and doesn't require the programmer to program massive amounts of logic?
Update:
For clarification, I know ASP.NET MVC is an option that will help a bit, but it won't give me a nice GridView. So I'm wondering if there is a 100% functional, 100% no-javascript replacement for the standard ASP.NET controls.
Thanks.
Update2:
It's been a while and I never found the exact answer I was looking for. Probably because what I want doesn't exist. So I'll go for ASP.NET MVC which is the next best thing.
ASP.Net MVC is probally the closest you'd get. You can use it to build a site without javascript. It is very different from Web forms
Many of the stock controls will be problematic. They just depend too heavily on Javascript. You do have some options, though:
ASP.Net MVC should give you a bit more control over your html
You can build your own replacement WebForms control library that doesn't rely on javascript to provide alternatives for controls that do.
What are the differences between jQuery and ASP.NET Ajax?
They are very separate things, jQuery is a JavaScript framework that has the ability to do some rudimentary Ajax functionality while ASP.NET Ajax is a more fully-featured Ajax framework that encompasses .NET controls and server-side aspects as well as client-side aspects.
jQuery's main focus is on a creating standard, stable, and powerful framework for working with JavaScript as a whole in the client.
Albeit ASP.NET AJAX encompasses a client side framework it is perhaps best known/feared/loathed for its server side controls, particularly the UpdatePanel. What you get with ASP.NET AJAX is out-of-the-box AJAX for the most basic stuff without having to write a single line of JavaScript.
If on the other hand you need to write some JavaScript or go a little out-of-the-box, working with ASP.NET AJAX can soon become a little tedious.
jQuery on the otherhand is lightweight and requires you to write JavaScript, although for most part, the jQuery guys has done a very good job of hiding the ugly JavaScript stuff away, so apart from a small learning curve it comes pretty natural (particularly if you are on home-stretch in CSS selectors).
Main problem in using jQuery with ASP.NET can be if you mess too much with the DOM you might get ViewState/Event validation problems.
jQuery is a standalone javascript library that can be integrated into any development environment. It it widely used and many great plugins exist for it.
It can be used for much much more than just AJAX functionality. Like traversing through current elements and changing their functionality.
ASP.NET AJAX is something else entirely, since it only focuses on AJAX like functionality in the .NET environment.
Main goal of ASP.NET Ajax is calling ASP.NET web services from client using simple JavaScript notation. It also provides client access to some ASP.NET server features. Like profile, for example. All other operations it's better to perform with jQuery.
i used Ajax Control Toolkit from microsoft quite extensively for 2 years before i switched to jQuery and in my experience i think jquery ajax calls are much more light weight, efficient compared to the ajax control toolkit libraries. besides that the efficiency ofcourse depends on the data that you send & receive via your ajax calls.
you can add custom HTTP Status codes in jQuery ajax calls as well to capture any errors on the server and returning the appropriate response.
#Andrew and #Ólafur hit the nail on the head, but I would add that the biggest concept that separates these two approaches to ajax development is that w/ jQuery you get total control of what happens between the client and the server. With the MS AJAX Toolkit you give up any control over what is sent between these 2 points. If you want to be "close to the metal" you would be best to choose jQuery. If you are just working up some quick and dirty solution that needs zero customization and speedy delivery is all your client cares about, maybe take a look at the MS AJAX Toolkit.
by the way - scott gu officially announced that asp.net would include support for jquery (full intellisense too) with their ajax framework (which is really bloated)
check this link - http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx
if you have used ms ajax, you would be aware its really really bloated up, and many things which ms ajax does - you can achieve via jquery writing few lines of javascript code, and you would save a lot on bandwidth and performance
you can even call asp.net json + xml web services via jquery writing just few lines of code