2013-05-16 30 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?

相關問題