By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,199 Members | 1,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,199 IT Pros & Developers. It's quick & easy.

What is the difference between PostBack & Callback? Please give sample code?

P: 24
Folks!

What is the difference between PostBack and Callback ( !IsPostBack and if(!IsCallback))

Like in the following Code Snippet:
Expand|Select|Wrap|Line Numbers
  1.         protected void Page_Load(object sender, EventArgs e)
  2.         {           
  3.             if (!IsPostBack)
  4.             {
  5.  
  6.             }
  7.  
  8.             if(!IsCallback)
  9.             {
  10.  
  11.             }
  12.         }


As far as I know, when I 1) refresh the page or 2) revert back to the page after round trip, the behavior is such that IsPostBack = !IsCallback. I don't find any difference.

Can you please explain with example code?

Just want a sample code (for Page_Load event) that will demonstrate the difference in the Page_Load event so that I can toggle breakpoint and understand it for myself.

Thanks.
Oct 24 '09 #1

✓ answered by PRR

A Postback occurs when the data (the whole page) on the page is posted from the client to the server.During a page postback, the Web page and controls are recreated and a new version of the entire Web page is rendered on the client.

Callback is also a special kind of postback, but it is just a quick round-trip to the server to get a small set of data.
Link

Determine How ASP.NET Web Pages Were Invoked
Page.IsPostBack
Page.IsCallback

Share this Question
Share on Google+
2 Replies


Expert 100+
P: 750
PRR
A Postback occurs when the data (the whole page) on the page is posted from the client to the server.During a page postback, the Web page and controls are recreated and a new version of the entire Web page is rendered on the client.

Callback is also a special kind of postback, but it is just a quick round-trip to the server to get a small set of data.
Link

Determine How ASP.NET Web Pages Were Invoked
Page.IsPostBack
Page.IsCallback
Oct 27 '09 #2

P: 24
Thanks for the reply!
Nov 3 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.