protected void Page_Load(object sender, EventArgs e) { try { var q = dc.Productions.Select(c => new { c.ID, c.Image, c.Info, c.Name, c.PurchaseItems, c.Price , c.cat_ID }); foreach (var item in q) { if (Convert.ToInt32(Request.QueryString.Get("cat_ID")) == Convert.ToInt32(da.getCatNameByName(DropDownList1.SelectedValue))); { HtmlGenericControl newControl = new HtmlGenericControl("div"); newControl.ID = item.ID.ToString(); newControl.InnerHtml = "<div class='col-md-4 product-left single-left'><div class='p-one simpleCart_shelfItem'><a href='EachSample.aspx?id=" + item.ID + "'><img src=../AdminCP/ProductImages/" + item.Image + " alt='' /><div class='mask mask1'><span>Quick View</span></div></a><h4>" + item.Name + "</h4><p><a class='item_add' href='#'> <span class=' item_price'>" + item.Price + "</span></a></p></div></div>"; main.Controls.Add(newControl); } } }
<div style=" background-color:white; width:100%" class="col-md-9 p-left"> <div class="product-one"> <div id="main" runat="server" class="col-md-4 product-left single-left"> </div> <div class="clearfix"> </div> </div> </div>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)