在用户自定义控件中实现回掉的时候,在A、B、C服务器上出现俩中问题。
A、B、C环境都一样,A、B可以实现回掉,也不会报错误。
C报错误The target 'UserLeft1' for the callback could not be found or did not implement ICallbackEventHandler(UserLeft1用户自定义控件)
A、B、C的代码是:
public partial class UserLeft : UserControlBase, ICallbackEventHandler
{
        protected string currentuserStringId;
        protected string  rel;
        public void RaiseCallbackEvent(string the_string)
        {
            rel = the_string;
        }
        public string GetCallbackResult()
        {
            if (rel == "1")
            {
                SetOnline(currentuserStringId, true);//自定义方法
                return "1";
            }
            else if (rel == "-1")
            {
                SetOnline(currentuserStringId, false);
                return "-1";
            }
            return "";
        }  

}然后把代码改为如下:A、B、C都可以执行,不报错误
A、B、c的代码是:
public partial class UserLeft : UserControlBase, ICallbackEventHandler
{
        protected string currentuserStringId;
        protected string  rel;
        void ICallbackEventHandler.RaiseCallbackEvent(string the_string)
        {
            rel = the_string;
        }
        string ICallbackEventHandler.GetCallbackResult()
        {
            if (rel == "1")
            {
                SetOnline(currentuserStringId, true);//自定义方法
                return "1";
            }
            else if (rel == "-1")
            {
                SetOnline(currentuserStringId, false);
                return "-1";
            }
            return "";
        }  

}