Create a DIV Tag using ASP.NET with C#

Hi Friends 
Here is the Code to create div through C# . 
 
 
System.Web.UI.HtmlControls.HtmlGenericControl newDiv =
        new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
    newDiv.ID = "newDiv";
    newDiv.Style.Add(HtmlTextWriterStyle.Height, "20px");
    newDiv.Style.Add(HtmlTextWriterStyle.Width, "300px");
 
    tbl.Controls.Add(dynDiv);

0 comments: