您的位置:首页 > 其它

自定义控件无法在VS.net编辑中显示

2004-09-25 10:46 369 查看
自己写了一个用户控件,拖入到编辑框只有如下图的样子,连鼠标都无法选中,怎么解决?

----------图片下方--------------------
public class SampleDesign
public class SampleDesigner : System.Web.UI.Design.ControlDesigner

public override string GetDesignTimeHtml()
// Component is the control instance, defined in the base
// designer
MyLabel myLable = (MyLabel)this.Component;
string html = myLable.GetHtml();

return html;

}
protected override string GetEmptyDesignTimeHtml()
String html = base.GetEmptyDesignTimeHtml ();
html = "<input type='text'"+html+">";
return html;
}
protected override string GetErrorDesignTimeHtml(Exception e)

String html = base.GetErrorDesignTimeHtml (e);
html = "<input type='text'"+html+">";
return html;
}

}

}
结果,出现了创建控件出错。指定转换无效

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: