views:

318

answers:

6

Can we combine both jQuery and ASP.NET AJAX in an ASP Web Application?

A: 

Probably, yes.

(Without more information on what you actually want, that is the best answer I can give.)

Ali A
+3  A: 

Yes. For caveats and potential work-arounds, see: Any downsides to using ASP.Net AJAX and JQuery together

Shog9
A: 

Yes, I'm doing it successfully right now.

mson
A: 

yes. in fact they compliment each other fairly well. They do have some overlap though. MS Ajax client libraries provide for .net-style markup and handling of data in js. jQuery is mainly an extension to the browser DOM.

I would suggest committing to one or the other for page-load/dom-ready handling. I would also suggest ms-ajax event handler notation if you are doing a lot of server-side calls via ms-ajax.

It comes down to being consistent in your use in areas of overlap.

Tracker1
+2  A: 

Considering that JQuery is intended to ship with Visual Studio, I'd say most definitely.

And, of course, I'm doing it quite well without any notable issues.

Mark Brackett
+1  A: 

Yes you can combine ASP.Net Ajax and Jquery, but just because they're shipped together in VS.Net doesn't mean that you should use them both in the same project.

In fact I recommend exactly the opposite. When you put a ScripManager on your form, there already is a pretty hefty download penalty for ASP.Net Ajax, add another 50 KBs of Jquery and you're bloating up your code for nothing.

If you're a JQuery fan, you're probably using it already to do much of what you do with ASP.Net Ajax, so if you can, consider getting rid of scriptmanager completely.

If you can't do that, or if you use updatepanels, then link the JQuery download to Google this way:

http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js (For ver 1.2.6)

Google promotes linking this way to minimize the necessity to download JQuery again and again. If most websites link from Google (the way google promotes it), then the user won't have to download new copies of JQuery every time they access a website that uses it.

Cyril Gupta

related questions