注册在web.config中的用户控件 [英] Register user control in web.config
问题描述
实施同一项目内的用户控件,我想引用它们在web.config中,以不包含在每一页的注册条款。
Implementing user controls inside the same project, I am trying to reference them in web.config in order to not include the Register clause in every page.
注册一个单一的控制,它正在:
Registering one single control it is working:
<pages>
<controls>
<add tagPrefix="myApp" src="/Controls/WebUserControl1.ascx" tagName="WebUserControl1"/>
</controls>
</pages>
但是,如果我尝试注册命名空间中的所有控件,它不工作:
But if I try to register all the controls in the namespace, it is not working:
<add tagPrefix="myApp" namespace="myApp.Web"/>
与错误应对:
未知服务器标记'对myApp:WebUserControl1。
Unknown server tag 'myApp:WebUserControl1'.
我使用VB.NET,我怀疑这可能是一些与命名空间有关。任何想法?
I am using VB.NET and I suspect that could be something related with Namespaces. Any ideas?
推荐答案
下面是一个类似的问题已经在左右。
Here is a similar question already on SO.
<一个href=\"http://stackoverflow.com/questions/680519/in-web-config-is-it-possible-to-register-all-user-controls-in-specified-director\">In Web.config文件是否可以登记在指定目录下的所有的用户控件
问候,
乌罗什
Regards, Uros
这篇关于注册在web.config中的用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!