ASP.NET control to render a <div> ASP.NET control to render a <div> asp.net asp.net

ASP.NET control to render a <div>


Of course: ASP.NET has a built-in control called Panel!

And you may use it as follows:

<asp:Panel ID="myPanel" runat="server">    <!-- Other markup here like client and server controls/elements --></asp:Panel>


I think you need HtmlGenericControl class. It has a constructor which accepts a string variable which initializes a new instance of the HtmlGenericControl class with the specified tag:

var div = new HtmlGenericControl("div");

It is also has InnerHtml and InnerText properties (you mentioned this in a comment to the previous answer).