关于ICallbackEventHandler网上已经有很多文章介绍了,这篇实为画蛇添足。
ICallbackEventHandler存在于System.Web.UI中,我们先做一个非常简单的例子来试用一下。
第一步,在VS2005中建立一个新的WEB窗件。
第二步,在ASPX中,放上一段HTML代码(如下):
1<body>
2 <form is just another parameter definition used. The value for this is passed from the client. clientErrorCallback Name of the method that is called from the CallBackManager in case of any errors.
从这个方法返回的string是:
__doCallback('__Page',arg,CallBackHandler,ctx, ErrorCallBack)
另一个重载方法是:
public string GetCallbackEventReference(
Control control, string argument,
string clientCallback, string context)
public string GetCallbackEventReference(
Control control, string argument,
string clientCallback, string context,
string clientErrorCallback)