在用户自定义控件中实现回掉的时候,在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 "";
}
}
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 "";
}
}
解决方案 »
- 【关于Form2.submit()】这个提交表单到底有什么用?
- 内容页如何触发母板页控件事件
- object error错误,高手请进!
- 操作两个数据库问题
- 一个关于asp.net的问题。。望各位给看看。。谢谢大家了。
- 如何在web form中实现Background类似的功能?
- 直接使用2.0自带的Login控件登陆后,用户名保存在哪里呢?其他页面使用用户名,怎么用?
- 李洪根的TreeView例子请问是怎样判定二级节点的ID呢,还有请问怎样按下节点后就跳转到相应的aspx页面呢?
- 关于自定义控件属性传值问题
- Form验证的问题,搞得我现在焦头烂额!
- 做个web系统出现问题了!
- js 导出网页上的数据到Excel 不同的sheet
是否签入了MasterPage???