一回发和回调的区别 [英] Difference between a Postback and a Callback

查看:170
本文介绍了一回发和回调的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不断听到这句话'的回调回发扔左右。

什么是两者之间的区别?

I keep on hearing this words 'callback' and 'postback' tossed around.
What is the difference between two ?

时的回传非常具体的ASP.NET页面?

Is postback very specific to the ASP.NET pages ?

推荐答案

在页面上的数据(整页)从客户端发布到server..ie在数据posted-出现回发返回到服务器,从而刷新页面(重绘)...把它当作'的发送服务器的整个页面(asp.net)全部数据的

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'.

使用Asp.Net,当调用回调函数,不像回发视​​图状态不会刷新。

With Asp.Net, the ViewState is not refreshed when a callback is invoked, unlike with a postback.

这是整个页面发布与ASP.Net的原因是因为ASP.Net封闭在&LT整个页面;形式> 发表方法,所以当一个提交按钮被点击的页面,形式发送到服务器与所有在表单中的字段......基本上整个页面本身。

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 to the server with all of the fields that are in the form... basically the whole page itself.

如果您正在使用的萤火虫的(适用于Firefox),你可以看到回调被调用到控制台服务器。这样的话,你会看到什么样的的具体数据的被发送到服务器(请求),并在服务器送你回数据(响应)。

If you are using FireBug (for Firefox), you can actually see callbacks being invoked to the server in the Console. 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).

下图所示都回传,并在基于ASP.NET网站回调的页面生命周期:

The below image illustrates the Page Life Cycles of both a postback and a callback in a ASP.NET based Website:

ASP.NET页面生命周期

这篇关于一回发和回调的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆