加入收藏 | 设为首页 | 会员中心 | 我要投稿 鄂州站长网 (https://www.0711zz.com/)- 数据分析、网络、云渲染、应用安全、大数据!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – WebForm_DoCallback定义

发布时间:2020-09-18 22:33:05 所属栏目:asp.Net 来源:互联网
导读:有关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

(编辑:鄂州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读