Here is what I do when I need to add markup.
on my page
<asp:PlaceHolder ID="MyPlaceholder" runat="server"></asp:PlaceHolder>
in my code
MyPlaceholder.Controls.Add(new Literal() { Text="<div>some markup</div>"});
I do it like this because:
1) you can place PlaceHolder where necessary in the structure of your page
2) by adding Literal at run time to the Controls collection, it prevents the inflation of the ViewState with its contents.
source share