Hello,
Thank you for the additional clarification. Upon further investigation it became apparent that this approach would not work for setting the container without modifying the source code. The source code checks for an instance of a Web part, which is used by templates and doesn't exist in this case. Instead of using the container, you would have to manually set the content before and content after properties similar to the following:
<cms:MyStaticText runat="server" ID="az" ContainerName="OrangeBox" Text="sample" />
aZ.ContentBefore = aZ.ContainerBefore;
aZ.ContentAfter = aZ.ContainerAfter;
You would still specify a container name so that the properties are available. Please let me know if you have any questions.
Regards,
Sandro