469,646 Members | 1,558 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

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

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

2 3903
PRR
750 Expert 512MB
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
Thanks for the reply!
Nov 3 '09 #3

Post your reply

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

Similar topics

12 posts views Thread by Nathan Sokalski | last post: by
2 posts views Thread by Wizzard | last post: by
3 posts views Thread by Angel Of Death | last post: by
2 posts views Thread by Nathan Sokalski | last post: by
3 posts views Thread by pearcewg | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.