2013-05-16 29 views
2
[ToolboxData("<{0}:WebUserControl1 runat=\"server\"></{0}:WebUserControl1>")] 
[ToolboxItem(true)] 
public partial class WebUserControl1 : System.Web.UI.UserControl  

当我把它拖出来并下降到aspx什么也没有发生。 当然,我已经把它转换成从这里的自定义控制Turning an ascx user control into a redistributable custom control如何将Web用户控件放入工具箱?

+0

转到:工具 - >选项 - > Windows窗体设计器并启用 “AutoToolboxPopulate” 选项。 – Rahul

+0

@Rahul这是“网络用户控制” – DevProve

回答

0

AFAIK你不能将ascx添加到工具箱。如果这是Windows窗体应用程序用户控件将自动显示在那里。 David的文章是关于将Web用户控件编译为单独的dll(仅适用于其网站而不是Web应用程序)并重新使用它。唯一的选择是您将其制作为工具箱中显示的复合控件。

How to drag a UserControl into the Toolbox?

相关问题