I am creating div's dynamically on a webform depending on items in a database and I want the first created divs to be positioned relative to an already existing div, then the the rest next to each other.
This is my code to create the div.
protected void createDiv()
{
HtmlGenericControl dynDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
dynDiv.ID = "dynDivCode"; dynDiv.Style.Add(HtmlTextWriterStyle.BackgroundColor, "Gray");
dynDiv.Style.Add(HtmlTextWriterStyle.Height, "20px");
dynDiv.Style.Add(HtmlTextWriterStyle.Width, "300px");
dynDiv.InnerHtml = "I was created using Code Behind";
this.Controls.Add(dynDiv);
}
Go to the complete details ...