protected void Page_Load(object sender, EventArgs e) { dt = dl.bind_testimonial(); StringBuilder htmlTable = new StringBuilder(); if (dt.table.Rows.Count > 0) { foreach (DataRow row in dt.table.Rows) { htmlTable.AppendLine("<div class=\"item\">"); htmlTable.AppendLine("<div class=\"testimonial theme-bg bottom_pos\">"); htmlTable.AppendLine("<div class=\"testimonial-avatar\">"); htmlTable.AppendLine("<img src=\"Handler.ashx?id=" + row["file_id"].ToString() + "\" width=\"100\" height=\"104px\" /> </div>"); htmlTable.AppendLine("<div class=\"testimonial-info\">" + row["testimonial"] + "</div>"); htmlTable.AppendLine("<div class=\"author-info\"><strong>" + row["name"] + " <br><span>Cell Salt User</span></strong> </div>"); htmlTable.AppendLine("</div></div>"); Literal1.Text = htmlTable.ToString(); } } }
public void testimonial() { olu_ba_layer bl = new olu_ba_layer(); olu_da_layer dl = new olu_da_layer(); ReturnClass.ReturnDataTable dt = new ReturnClass.ReturnDataTable(); ReturnClass.ReturnDataTable dtt = new ReturnClass.ReturnDataTable(); ReturnClass.ReturnBool rb = new ReturnClass.ReturnBool(); dt = dl.bind_testimonial(); StringBuilder htmlTable = new StringBuilder(); string file_id = null; if (dt.table.Rows.Count > 0) { foreach (DataRow row in dt.table.Rows) { bl.User_id = row["user_id"].ToString(); dtt = dl.bind_testimonial_file_id(bl); if (dtt.table.Rows.Count > 0) { file_id = dtt.table.Rows[0]["file_id"].ToString(); } else { file_id = "7"; } htmlTable.AppendLine("<div class=\"grid-item photography branding\">"); htmlTable.AppendLine("<div class=\"item\">"); htmlTable.AppendLine("<div class=\"testimonial theme-bg bottom_pos\">"); htmlTable.AppendLine("<div class=\"testimonial-avatar\">"); htmlTable.AppendLine("<img src=\"online_user/Handler.ashx?id=" + file_id + "\" width=\"100\" height=\"104px\" /> </div>"); htmlTable.AppendLine("<div class=\"testimonial-info\">" + row["testimonial"] + "</div>"); htmlTable.AppendLine("<div class=\"author-info\"><strong>" + row["name"] + " <br><span>Cell Salts User</span></strong> </div>"); htmlTable.AppendLine("</div></div></div>"); // Literal1.Text = htmlTable.ToString(); } } }