On my page I have a table and in each cell of the table I have placeholder. I am readring from a database and each table in the database is represented by each placeholder of the table on my page. For example, one of the placeholder id is "xyz_P". there is a tabel in the database called "xyz". when loading the page, I am looking for a record in each table of the database. so if xyz has the record I am looking for, I will programatically create a Datalist called xyz_D inside the xyz_P Placeholder. then I load a template in the database and bind the data to the datalist.
The following is my loading code:
if(reader.HasRows == true)
{
cName = new DataList();
cName.DataSource = reader;
cName.ItemTemplate = Page.LoadTemplate("template/wData/" + tabName + ".ascx");
cName.ID = tabName + "_DataList";
status.Text += cName.ID.ToString() + "\n";
cName.DataBind();
placeHolderName.Controls.Add(cName);
}
now if the user clicks the submit button I am trying to read the form back to the database. I can say the following code:
PlaceHolder ph = (PlaceHolder)Page.FindControl("xyz_P");
and find it. but then I can't find any control inside ph.
any idea why?
I simply need to find the datalist xyz_D and the checkboxes inside it. any idea how to read them back.