Click here to Skip to main content
12,755,975 members (35,788 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


9 bookmarked
Posted 19 Mar 2014

Difference between a Postback and a Callback in ASP.NET

, 19 Mar 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
Difference between a postback and a callback in ASP.NET
"A postback is a request sent from a client to server from the same page, user is already working with."

ASP.NET was introduced with a mechanism to post an HTTP POST request back to the same page. It's basically posting a complete page back to server (i.e. sending all of its data) on the same page. So, the whole page is refreshed.

In order to understand how this postback mechanism works in ASP.NET, follow the simple steps:

  • Add a new ASP.NET web form page to a project, e.g., WebForm1.aspx.
  • View the page code in HTML Source view. You will find something like the following screen:

    Look at the form line of code.

    <form id="form1" runat="server">

    It represents a server-side implementation of form control.

  • Now just run the application to see WebForm1.aspx page and view its source code. HTML source of the page will display form element as follows:

    <form method="post" action="WebForm1.aspx" id="form1">

    You can see that an HTML form element generated with an HTTP method as "POST" and action="WebForm1.aspx". So, if a submit button is clicked, the page will postback to itself by default.

"A callback is generally a call for execution of a function after another function has completed."

But if we try to differentiate it from a postback, then we can say: It's a call made to the server to receive specific data instead of whole page refresh like a postback. In ASP.NET, it's achieved using AJAX, that makes a call to server and updating a part of the page with specific data received.

Related Web Development Tutorials


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Imran Abdul Ghani
Software Developer (Senior) Emaratech
United Arab Emirates United Arab Emirates
Imran Abdul Ghani has more than 10 years of experience in designing/developing enterprise level applications. He is Microsoft Certified Solution Developer for .NET(MCSD.NET) since 2005. You can reach his blogging at WCF Tutorials, Web Development, SharePoint for Dummies.

You may also be interested in...


Comments and Discussions

GeneralMy vote of 5 Pin
Humayun Kabir Mamun21-Mar-14 1:38
memberHumayun Kabir Mamun21-Mar-14 1:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170217.1 | Last Updated 19 Mar 2014
Article Copyright 2014 by Imran Abdul Ghani
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid