# Other Programming > AJAX >  what's the difference between asp.net and ajax?

## FlyingBear

Hi,

I'm new at ajax. got a book and started to read it. one question come to my mind: what's the difference between asp .net and ajax? it seems asp .net can do most work that ajax can do, and asp.net is not complex.



thanks


bear

----------


## wildfrog

*A*synchronous *J*avaScript *A*nd *X*ML is a _client side_ technique to make web pages more 'seamless' and interactive. As in the name, it consist of a mixture of javascripting and xml (XMLHTTPRequest)

A typical ASP.NET web page contains buttons and links that perform socalled postbacks when clicked. That is, a request is sent back to the server and the whole page (or frame) is reloaded. It doesn't always look nice. 

With AJAX the postback is performed in the background. For instance when a button is clicked it calls a script which in turn sends a request to the server. Upon response the script may choose to update only parts of the page (update an image or add a row to a table etc.). The result is a better experience for the user (no flashing or partially loaded pages and so on). 

You can use ASP.NET to create AJAX enabled pages.

- petter

----------


## FlyingBear

thanks. simply put, ajax is more efficient than asp .net, am I right?




> You can use ASP.NET to create AJAX enabled pages.
> 
> - petter


do you mean I can use javascript+asp.net to create ajax pages? I read a book which uses javascript+php. I do not know php, and want to use javascript+asp.net for ajax, is it possible?

any examples?


thanks again.


bear

----------


## FlyingBear

found many examples for ajax+asp.net from google, thanks



Bear

----------


## wildfrog

> simply put, ajax is more efficient than asp .net, am I right?


Yes, it can be used to make it more efficient. For instance if you got a webforum with lots of posts and advertisement. The, when you click 'update page' or something then the script can tell the webserver to only send recent posts, not the whole page. And then the script merges then new posts with those that are already there. This can reduce bandwith and load on the web servers/database.

Another example is webpages that take some time to load. Lets say flight ticket search engines. When you search for a ticket from one destination to another you first get a web page with an 'empty' result. But, in the background the javascript is in constant communication with the server, and as soon as a ticket is found the webpage is updated. So, instead of waiting for all tickets (one minute looking at a blank webpage), the user can see (and work) with the partial result as he is waiting for the  rest to come.

- petter

----------

