asp:Literal control null in user control

前端 未结 7 1817
南旧
南旧 2021-01-13 10:51

I\'ve a user control which contains asp:Literal.

相关标签:
7条回答
  • 2021-01-13 11:16

    It depends on exactly how you're including the controls in your web.config. It will not work if you try to include all of the controls in a namespace (although the designer will correctly show you the list of your controls):

    <add tagPrefix="prefix" namespace="example.ui.controls" assembly="example.ui" />
    

    But if you add your control(s) individually and point to their physical location(s), it will work as you expect without having to include endless @Register directives.

    <add tagPrefix="prefix" tagName="Message" src="~/Controls/Message.ascx" />
    
    0 讨论(0)
提交回复
热议问题