I\'ve a user control which contains asp:Literal.
If MenuContainer is null, it probably has something to do with the time line of the page life cycle. You're calling that function before MenuContainer is linked up. Can you try calling Setup in the Page_Load function?
MenuContainer
Setup