<div runat="server" ID="divCategory"> <div class="item"> <div class="col-lg-12"> <div class="col-sm-3"> <img src="1.png" /><br /> </div> <div class="col-sm-3"> <img src="1.png" /><br /> </div> <div class="col-sm-3"> <img src="1.png" /><br /> </div> <div class="col-sm-3"> <img src="1.png" /><br /> </div> </div> <div class="col-lg-12"> <div class="col-sm-3"> <img src="1.png" /><br /> </div> <div class="col-sm-3"> <img src="1.png" /><br /> </div> <div class="col-sm-3"> <img src="1.png" /><br /> </div> <div class="col-sm-3"> <img src="1.png" /><br /> </div> </div> </div> </div>
HtmlGenericControl divItem = new HtmlGenericControl("div"); divItem.Attributes["class"] = "item"; HtmlGenericControl divColumnH = new HtmlGenericControl("div"); divColumnH.Attributes["class"] = "col-lg-12"; HtmlGenericControl divColumnD = new HtmlGenericControl("div"); divColumnD.Attributes["class"] = "col-sm-3"; Image img = new Image(); img.ImageUrl = "1.png"; img.Visible = true; divCategory.Controls.Add(divItem); divItem.Controls.Add(divColumnH); for (int i = 0; i < 4; i++) { divColumnH.Controls.Add(divColumnD); divColumnD.Controls.Add(img); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)