Hi
I am having a problem of getting the value from the dynamically generated table and dropdownlist. What I am facing is, I have created a table in the aspx page and now I need to add values to the the cells of the table respectively which I have done easily but the problem is when I add the dynamically generated dropdownlist to the cell I cannot read the value from the dropdownlist.
For adding the dropdownlist in the cell I have done the following:
cellName.controls.add(dropdownlistName);
When I perform the above action I can view the dropdownlist in the table but cannot get the value from the dropdownlist.
So how can this be done?
DropDownList ddl = new DropDownList();
ddl.ID = "drop" + j;
ddl.Items.Clear();
ddl.Items.Add("PP");
ddl.Items.Add("PD");
ddl.Items.Add("DP");
ddl.Items.Add("DD");
ddl.Items[0].Selected = true;
TableRow r = new TableRow();
TableCell c = new TableCell();
c.Controls.Add(ddl);
r.Cells.Add(c);
Table1.Rows.Add(r);
Table1 is the table that I defined at aspx page
Any help is appreciated