try { //Panel1.Controls.Add(new LiteralControl("<table id="as">")); Table td=new Table(); td.ID = "td"; TableRow tr; TableCell tc; TableCell tc2; TableCell tc3; int counter = GridView1.Rows.Count; for (int i = 0; i < counter; i++) { CheckBox cb = ((CheckBox)(GridView1.Rows[i].Cells[0].FindControl("CheckBox1"))); Label lb1 = ((Label)(GridView1.Rows[i].Cells[1].FindControl("label1"))); Label lb2 = ((Label)(GridView1.Rows[i].Cells[2].FindControl("label2"))); Label lb3 = ((Label)(GridView1.Rows[i].Cells[3].FindControl("label3"))); Label lb4 = ((Label)(GridView1.Rows[i].Cells[4].FindControl("label4"))); if (cb.Checked == true) { tr=new TableRow(); //Panel1.control tc=new TableCell(); Label lb = null; lb = new Label(); lb.ID = "lb" + i.ToString(); lb.Text = lb1.Text; tc.Controls.Add(lb); tr.Controls.Add(tc); tc2 = new TableCell(); // this.Panel1.Controls.Add(lb); // Panel1.Controls.Add(new LiteralControl(" ")); string sdf = (lb2.Text +" "+ lb3.Text +" "+ lb4.Text).ToString(); Label lb5 = null; lb5 = new Label(); lb5.ID = "lb" + i.ToString(); lb5.Text = sdf; tc2.Controls.Add(lb5); tr.Controls.Add(tc2); // this.Panel1.Controls.Add(lb5); //Panel1.Controls.Add(new LiteralControl(" ")); TextBox tb = null; tb = new TextBox(); tb.ID = "txt" + i.ToString(); tc3 = new TableCell(); tc3.Controls.Add(tb); tr.Controls.Add(tc3); td.Rows.Add(tr); //this.Panel1.Controls.Add(tb); // Panel1.Controls.Add(new LiteralControl("<br>")); // Panel1.Controls.Add(new LiteralControl("<br>")); } else { } } Panel1.Controls.Add(td); } catch (Exception re) { Response.Write("<script language='javascript'>alert('" + re.Message + "');</script>"); } finally { } </br></br></table>
if (Panel1.Controls.Count == 0) { } else { Table tf = (Table)this.Panel1.FindControl("td"); int counter = tf.Rows.Count; for (int i = 0; i < counter; i++) { } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)