views:

3933

answers:

4

I keep on hearing this words 'callback' and 'postback' tossed around.
What is the difference between two ?

Is postback very specific to the ASP.NET pages ?

+43  A: 
Andreas Grech
Actually, a callback is a more general programming term for a function that needs to be executed after another function has completed.
Ryan Doherty
It's when a pointer to a function gets passed to another function, that it will later invoke
Andreas Grech
Thanks for taking time to put a very nice explanatory diagram.
Biswanath
I agree - +1 for diagram
barfoon
+1 for the explanation and diagram
etsuba
(July) Was it really worth bumping this old post with a trivial update to somebody else's old answer?
Marc Gravell
+5  A: 

A postback occurs when a request is sent from the client to the server for the same page as the one the user is currently viewing. When a postback occurs, the entire page is refreshed and you can see the typical progression on the progress bar at the bottom of the browser.

A callback, generally used with AJAX, occurs when a request is sent from the client to the server for which the page is not refreshed, only a part of it is updated without any flickering occuring on the browser

Sanket
+1  A: 

I agree with Dreas' answer, but I'd like to add a couple of points. Postback is a term that gets introduced very recently by ASP .NET programming as Dreas explained, whereas callback is more generic and has been used way before web development exists. In fact I first heard about callback back in the days when I started programming in C (maybe the term existed before that, I don't know) and it simply means a pointer to function and this pointer to a function (name this A) gets passed to another function (name this B) which will later invoke A. Callback is also recently used by Yahoo UI Connection Manager and other Ajax frameworks but I believe the term had its first use back in the old C days.

Khnle
A: 

A postback occurs when a request is sent to a server no need give details about security for each request.

When u make a request for the other page callback is used by the server