views:

411

answers:

10

my friend mentioned to me that since i was only using update panels on my asp.net site, i really wasn't really using direct AJAX functionality. what is he talking about?

A: 

I don't know.

By using the update panels, .net ajax, under the hood, is requesting the content for that page and putting it in the panel. This is a fairly classical 'ajax' implementation.

He may be referring to posting data using ajax calls, which the ajax panel also covers, but in a different way to how you may do it using jQuery.

Noon Silk
A: 

Maybe he's upset that you have pretty excellent cross-browser AJAX functionality without having to suffer a thousand JavaScript paper cuts.

dnord
Wow, why is this getting downvoted?
Chris Pebble
A: 

Update panels ARE AJAX Extensions, if that's what you're asking. ASP.NET says so!

aredkid
A: 

Maybe he wants your to fully use the AJAX Control toolkit - that is implement the dragPanels, HTMLEditor, Calendar, animation, accordion etc etc.

If so, show him the middle finger gesture in a kind way :)

waqasahmed
+3  A: 

UpdatePanels are using ajax but you're so abstracted away from how it really works.

When you use UpdatePanels ajax comes for "free" - and while that is cool for a small-ish application when you get to a large app with a lot of UpdatePanels they will fall down. And when this happens I would venture to guess most asp.net devs wouldn't know where to start because the underlying technology has been hidden from them.

Make your buddy happy and tell him you're getting started with jQuery ;)

Andy Gaskell
+5  A: 

Strict AJAX means using asynchronous Javascript (using the JS XmlHttpRequest object) and XML (or JSON). That means making a very lightweight call back to your server or other service, taking the results, and processing them in some way on the client. Both sides (the request and response handling) require writing Javascript.

ASP.NET UpdatePanels do this, but 'hide' all the details from you. That is, their data transfer payload 'looks' like a standard form POST, and the data returned is really a block of HTML that is literally inserted/replaced into the current page.

This makes calls 'heavier' on the server (since the entire Page lifecycle must be completed) and on bandwidth usage. Newer technologies such as ASP.NET MVC do not require/use UpdatePanels and can use lightweight JSON services to return data, but you must write the Javascript to 'deal with it' on the client end (bind it into the UI somehow).

Jason
what is the best example if i have an ajax update panel website and i want to move to more low level code to deal with this.
ooo
I think this SO question could help you - http://stackoverflow.com/questions/415711/replace-updatepanel-with-jquery
Andy Gaskell
A: 

He's probably referring to the client-side library for ASP.NET AJAX which gives you direct access to the AJAX that powers the update panels.

He is wrong in the sense that update panels don't rely on core ajax technology -- they do. He may be correct in the sense that there's a lot more you can do with AJAX then the update panels allow.

Chris Pebble
+3  A: 

He might be speaking to the way that the UpdatePanel receives a lot more data than you are probably intending for it to. This website gives some good examples: Why ASP.NET AJAX UpdatePanels are dangerous. Here is another page from the same site that gives some good pointers on Are you making these 3 common ASP.NET AJAX mistakes?.

Chris Porter
A: 

This may sound a little subjective, but I have some really good experiences and some really bad experiences with UpdatePanel (and yes, UpdatePanel is real AJAX).

Good: UpdatePanel made it easy to easily retrofit AJAX functionality into existing web pages without a significant rewrite.

Bad: UpdatePanel posts back all of the page data. I have seen significant performance problems because of this. If a traditional ASP.Net page has view state data of sufficient size then an UpdatePanel is not going to perform well. This view state data being available on the server is convenient, but doesn't scale well either in the number of users not to large datasets.

Like many tools a programmer has at their disposal an UpdatePanel is neither good nor bad. It depends upon the usage.

Jason Jackson
+2  A: 

Strictly speaking I would have to agree that the UpdatePanel is, in fact, AJAX.

What most folks consider AJAX is far more streamlined than what the UpdatePanel does. Many ajax features on a web page involve performing some very specific activity - using the a client side HTTP request to process some information on the server, get back a response and then update something on the page based on the response.

The UpdatePanel operates in much the same way but on a more macro level. The UpdatePanel includes code that essentially posts the form, or elements of the form, back to the page such that from the server side it is transparent, you can handle and process your postback events the same way you would without using an UpdatePanel.

The JavaScript libraries associated with the UpdatePanel then refresh only the portions of the page wrapped in your update panel(s).

The JavaScript bundled with the UpdatePanel does use the http request to post the data and does receive Xml in response - this is also asynchronous. So, it is AJAX. The details are just hidden from you. Just because you aren't directly manipulating the request and processing the response doesn't mean its not AJAX. The UpdatePanel, however, is a bit more traffic/payload heavy than what many consider a typical AJAX implementation.

James Conigliaro