积极答复者
asp.net 自定义控件

问题
答案
-
自己刚刚开发完一个控件,怎么能让这个控件出现在工具箱中.
这个控件类在我的项目里面, 如何才能在工具箱中显示出来
你应该选择其中的一种方法:
1)你可以自己写一个类继承System.Web.UI.Control或者WebControl,这样的类编译之后自动会出现在ToolBox中,或者干脆创建一个“服务器控件”,使用这个模板:
2)把UserControl转换成Customized Control(英文的Sample):
http://www.codeproject.com/Articles/20792/Convert-the-web-user-controls-into-custom-controls
- 已标记为答案 Mike FengModerator 2012年10月8日 10:58
全部回复
-
您好
一般你重新编译下这个工程,这些控件就出现在toolbox里了。
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
如果你的控件没问题的话,你也可以直接用代码将控件添加到你的程序里,而不一定非要拖.
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
自己刚刚开发完一个控件,怎么能让这个控件出现在工具箱中.
这个控件类在我的项目里面, 如何才能在工具箱中显示出来
你应该选择其中的一种方法:
1)你可以自己写一个类继承System.Web.UI.Control或者WebControl,这样的类编译之后自动会出现在ToolBox中,或者干脆创建一个“服务器控件”,使用这个模板:
2)把UserControl转换成Customized Control(英文的Sample):
http://www.codeproject.com/Articles/20792/Convert-the-web-user-controls-into-custom-controls
- 已标记为答案 Mike FengModerator 2012年10月8日 10:58