asp.net – WebForm_DoCallback定义

有关WebForm_DoCallback功能的MSDN的简单说明吗? 我可以找到的是这篇文章http://msdn.microsoft.com/en-us/magazine/cc163878.aspx 其中包括WebForm_DoCallback的实现,但是不能很好地解释参数本身. function WebForm_DoCallback(eventTarget, eventArgument,

有关WebForm_DoCallback功能的MSDN的简单说明吗?

我可以找到的是这篇文章http://msdn.microsoft.com/en-us/magazine/cc163878.aspx
其中包括WebForm_DoCallback的实现,但是不能很好地解释参数本身.

function WebForm_DoCallback(eventTarget,eventArgument,eventCallback,context,errorCallback)

像什么是“eventTarget”呢?
什么是“上下文”?
等等…

解决方法

WebForm_DoCallback似乎是客户端对应的
GetCallbackEventReference.它生成与相同的参数,如下所示:

target: The name of a server Control that handles the client
callback. The control must implement
the ICallbackEventHandler interface
and provide a RaiseCallbackEvent
method.

argument: An argument passed from the client script to the server
RaiseCallbackEvent method.

clientCallback: The name of the client event handler that receives the
result of the successful server event.

context: Client script that is evaluated on the client prior to
initiating the callback. The result of
the script is passed back to the
client event handler.

clientErrorCallback: The name of the client event handler that receives
the result when an error occurs in the
server event handler.

useAsync: true to perform the callback asynchronously; false to
perform the callback synchronously.

clientCallback和clientErrorCallback是客户端(通常是JavaScript)函数,参数的格式如下:

function clientCallback(returnmessage,context) {}

其中returnmessage是来自服务器的响应(或错误),上下文与之前传递的上下文相同.

参考文献:

MSDN: ClientScriptManager.GetCallbackEventReference Method

MSDN Magazine: Implications of Script Callbacks in ASP.NET

ESRI Developer Network: Page Postbacks and Client Callbacks

作者: dawei

【声明】:永州站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

为您推荐

联系我们

联系我们

0577-28828765

在线咨询: QQ交谈

邮箱: xwei067@foxmail.com

工作时间:周一至周五,9:00-17:30,节假日休息

返回顶部