AJAX v. Postback

  • Thread starter Thread starter Siegfried Heintze
  • Start date Start date
S

Siegfried Heintze

Can someone kindly explain to me the difference between AJAX and a postback?

I coded AJAX calls in javascript to web services extensively back in
2003-2004 before the term AJAX as coined.

I've used postback with ASP.NET with Visual Studio.

They seem very similar. How does ASP.NET implement a postback so that it
does not have to update the screen?

Why would you want to use AJAX instead of postback?

Thanks,
Siegfried
 
Can someone kindly explain to me the difference between AJAX and a
postback?

AJAX allows a portion of the page to be updated without needing to update
the entire page

How does ASP.NET implement a postback so that it does not have to update
the screen?

It doesn't - that's what AJAX is for.

Why would you want to use AJAX instead of postback?

When you want to update a portion of the page without updating the entire
page.
 
Siegfried Heintze said:
Can someone kindly explain to me the difference between AJAX and a
postback?

I coded AJAX calls in javascript to web services extensively back in
2003-2004 before the term AJAX as coined.

I've used postback with ASP.NET with Visual Studio.

They seem very similar. How does ASP.NET implement a postback so that it
does not have to update the screen?

Why would you want to use AJAX instead of postback?

It allows for a more responsive user experience, in theory anyhow.
A fair number of asp.net webforms will have autopostback set on several
controls because you have to select this before it can decide what to show
in that or whatever. They send the entire page back to the server, the code
on the server does it's stuff and the whole page is sent back.
Maybe all to see if a check box was checked.
So what the user sees is he clicks some check box, the whole page jumps and
flickers.... and on he goes.
This disturbs some people because they don't understand what's going on and
just want the thing to work like a windows app.

Ajax allows you to send a smaller portion of the page back and forth.
So it can reduce IO.
There again if ajax is over-used you can find IO going up, but that's a
different story.

You know when you use a search engine and type in your criteria?
And it comes up with a bunch of suggestions as you type.
Ever thought about how a web page does that?
 
Can someone kindly explain to me the difference between AJAX and a
postback?

A postback is the submit mechanism built since the beginning into browsers
and allows by design to send a request (including all forms fields) to a web
server that respond with a new page that is then displayed and entirely
replace the current page.

To complement this, the idea is to be able to send a request to a web server
but without any relation to the display. This way you can send what you want
to a web server and process the response as you wish (possibly to update a
part of the page but could be used also just to send updates and get a
confirmation that the update happened on the server or whatever else you
could wish).
 
Siegfried Heintze said:
Can someone kindly explain to me the difference between AJAX and a
postback?

I coded AJAX calls in javascript to web services extensively back in
2003-2004 before the term AJAX as coined.

I've used postback with ASP.NET with Visual Studio.

They seem very similar.

On a technical level, they are exactly the same. From the client side, they
are seen a bit differently, of course.
How does ASP.NET implement a postback so that it does not have to update
the screen?

By using JavaScript to get the data and then using JavaScript to paint a
portion of the screen.
Why would you want to use AJAX instead of postback?

To give the user the appearance things are going faster.

--
Peace and Grace,
Greg

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

************************************************
| Think outside the box! |
************************************************
 
Back
Top