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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • qwedster
    New Member
    • Jul 2008
    • 24

    #1

    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:
    Code:
            protected void Page_Load(object sender, EventArgs e)
            {           
                if (!IsPostBack)
                {
    
                }
    
                if(!IsCallback)
                {
    
                }
            }


    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.
    Last edited by Frinavale; Oct 27 '09, 01:42 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    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

    Comment

    • qwedster
      New Member
      • Jul 2008
      • 24

      #3
      Thanks for the reply!

      Comment

      Working...