ICallbackEventHandler.RaiseCallbackEvent(String) 方法

定义

处理以控件为目标的回调事件。Processes a callback event that targets a control.

public:
 void RaiseCallbackEvent(System::String ^ eventArgument);
public void RaiseCallbackEvent (string eventArgument);
abstract member RaiseCallbackEvent : string -> unit
Public Sub RaiseCallbackEvent (eventArgument As String)

参数

eventArgument
String

一个字符串,表示要传递到事件处理程序的事件参数。A string that represents an event argument to pass to the event handler.

注解

null 用作事件参数参数时,字符串将被序列化为 "null" 并发送回服务器。When null is used as the event argument parameter, the string is serialized to "null" and sent back to the server. 由于没有办法区分 null 和 "null",因此应避免将 null 参数参数用于回调。Because there is no way to distinguish between null and "null", you should avoid using null argument parameters with callbacks.

中引发的异常 RaiseCallbackEvent 不会阻止 GetCallbackResult 调用并返回结果。Exceptions thrown in RaiseCallbackEvent will not prevent GetCallbackResult from being called and returning a result. 若要防止 GetCallbackResult 返回结果,请在中引发异常时设置标志, RaiseCallbackEvent 并从返回空字符串 GetCallbackResultTo prevent GetCallbackResult from returning a result, set a flag when an exception is thrown in RaiseCallbackEvent and return an empty string from GetCallbackResult.

适用于

另请参阅