Difference between a Postback and a Callback
A Postback occurs when the data (the whole page) on the page is posted from the client to the server..ie the data is posted-back to the server, and thus the page is refreshed (redrawn)...think of it as 'sending the server the whole page (asp.net) full of data'.
On the other hand, a 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 (normally), and thus the page is not refreshed, unlike with the postback...think of it as 'calling the server, and receiving some data back'
With Asp.Net, the ViewState is not refreshed when a callback is invoked, unlike with a postback.
The reason that the whole page is posted with ASP.Net is because ASP.Net encloses the whole page in a <form>
with a post method, and so when a submit button is clicked in the page, the form is sent ot the server with all of the fields that are in the form...basically the whole page itself
If you are using FireBug (for Firefox), you can actually see callbacks being invoked to the server in theConsole
. That way, you will see what specific data is being sent to the server (Request
) and also the data the server sent you back (Response
)
The below image illustrates the Page Life Cycles of both a postback and a callback in a ASP.NET based Website:
From:http://stackoverflow.com/questions/365100/difference-between-a-postback-and-a-callback
🐳 作者:dupeng0811 📢 版权:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接 💬 留言:同时 , 如果文中有什么错误,欢迎指出。以免更多的人被误导。 |
|