asp:Literal control null in user control

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

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

7条回答
  •  一个人的身影
    2021-01-13 11:05

    Thanks, TheVillageIdiot, for posting the answer to your problem - I ran into exactly the same misunderstanding.

    Adding controls via

    
    

    in the web.config was not enough to actually use it! I tried it like this on a page:

    
    

    ... but this would lead to the phenomenon, that none of the controls inside the UserControl were initialized. Only adding

    <%@ Register Src="~/UserControlsAccount/LoginMessages.ascx" TagPrefix="user" TagName="Messages" %>
    

    to the top of the page solved the problem :-)

    Thanks again!

提交回复
热议问题