将我自己的控件添加到工具箱
有谁知道为什么我无法将继承 AjaxControlToolKit 控件的子类添加到 ToolKit 中?我显式地实现了 IComponent ,但实际上我并不需要这样做,因为父级中的 IControl 已经实现了 IComponent 。我将编译代码,并尝试添加 DLL,但收到“不包含任何控件”错误。我知道这是一个非常具体的错误,因此其他地方没有太多帮助。
[System.ComponentModel.DesignerCategory("Component"),
ToolboxData("<{0}:TabPanelWithDataBinding runat=server></{0}:TabPanelWithDataBinding>")]
public class TabPanelWithDataBinding : TabPanel, IComponent, IDisposable
{
//all the meat stuff
}
Does anyone know why I can't add a subclass that inherits a control from AjaxControlToolKit to the ToolKit? I explicitly implemented IComponent which I didn't really have to since the IControl in the parent implements IComponent already. I'll compile the code, and try to add the DLL but I get the "doesn't contain any controls" error. I know this is a very specific error so there wasn't much help elsewhere.
[System.ComponentModel.DesignerCategory("Component"),
ToolboxData("<{0}:TabPanelWithDataBinding runat=server></{0}:TabPanelWithDataBinding>")]
public class TabPanelWithDataBinding : TabPanel, IComponent, IDisposable
{
//all the meat stuff
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因为您的基类“
TabPanel
”有一个属性[ToolboxItem(false)]
。它确实从程序集中过滤了控件。您可以尝试使用true
作为参数将此属性添加到控件中。Because your base class "
TabPanel
" has an attribute[ToolboxItem(false)]
. Which does filter the control from the assembly. You can try adding this attribute to your control withtrue
as argument.