Asp.net Web.config在另一个项目中注册用户控件
我有一个.Net项目,名为: Whatever.Web.UI:我使用这个项目来放置所有自定义控件和用户控件,这些控件将在所有网站项目中重用。这些文件分为两个文件夹:Asp.net Web.config在另一个项目中注册用户控件,asp.net,user-controls,web-config,Asp.net,User Controls,Web Config,我有一个.Net项目,名为: Whatever.Web.UI:我使用这个项目来放置所有自定义控件和用户控件,这些控件将在所有网站项目中重用。这些文件分为两个文件夹: - CustomControls folder (with all the custom controls) - UserControls folder (with all the user controls) 这是将来应该使用这些用户和自定义控件的web项目的示例 Whatever.Web.UI.WebSite1 W
- CustomControls folder (with all the custom controls)
- UserControls folder (with all the user controls)
这是将来应该使用这些用户和自定义控件的web项目的示例
Whatever.Web.UI.WebSite1
Whatever.Web.UI.WebSite2
....
....
....
不管怎样。Web.UI.WebSiteN
要在每个网站项目中使用自定义控件不是问题,我使用以下方法在web.config中注册了它:
<add tagPrefix="CustomControls" namespace="Whatever.Web.UI.CustomControls" assembly="Whatever.Web.UI"/>
但是,为了显示每个网站,我如何注册用户控件,并考虑到它们有一个我需要引用的ascx部分
提前谢谢。
亲切问候,,
约瑟马。
<system.web>
<pages>
<controls>
<add src="~/UserControls/MyControl.ascx" tagName="MyControl" tagPrefix="MyControls"/>
</controls>
</pages>
</system.web>