hello i have these codes in a page:
1st loop:
2nd loop:Code:for (int i = 1; i <= recordCount5; i++) { if (dr.HasRows) { dr.Read(); ////1st row - Add Text to cell and add Cell to Row htRow = new HtmlTableRow(); htCell = new HtmlTableCell(); htCell.Align = "left"; htCell.InnerText = "***" + dr["QUESTION"].ToString(); htRow.Cells.Add(htCell); tbl.Rows.Add(htRow); htCell = new HtmlTableCell(); DropDownList cbo5 = new DropDownList(); cbo5.SelectedIndexChanged += new EventHandler(cbo5_SelectedIndexChanged); cbo5.ID = "cbo5" + i.ToString(); cbo5.Items.Add(""); cbo5.Items.Add("1"); cbo5.Items.Add("2"); cbo5.Items.Add("3"); cbo5.Items.Add("4"); cbo5.Items.Add("5"); htCell.Controls.Add(cbo5); htRow.Cells.Add(htCell); } }
how would i get all the values in the loop?Code:for (int i = 1; i <= recordCount6; i++) { if (dr.HasRows) { dr.Read(); ////1st row - Add Text to cell and add Cell to Row htRow = new HtmlTableRow(); htCell = new HtmlTableCell(); htCell.Align = "left"; htCell.InnerText = " " + dr["QUESTION"].ToString(); htRow.Cells.Add(htCell); tbl.Rows.Add(htRow); htCell = new HtmlTableCell(); DropDownList cbo6 = new DropDownList(); cbo5.SelectedIndexChanged += new EventHandler(cbo5_SelectedIndexChanged); cbo6.ID = "cbo6" + i.ToString(); cbo6.Items.Add(""); cbo6.Items.Add("1"); cbo6.Items.Add("2"); cbo6.Items.Add("3"); cbo6.Items.Add("4"); cbo6.Items.Add("5"); htCell.Controls.Add(cbo6); htRow.Cells.Add(htCell); } }
tnx




Reply With Quote