Hi,
in my aspx page I have somting like that:
<asp:Content ID="Content1" ContentPlaceHolderID="Body" Runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" ChildrenAsTriggers="true" UpdateMode="Conditional" runat="server" >
<ContentTemplate>
<asp:Panel ID="Panel1" runat="server">
<asp:Table ID="PO_Tags" Width="90%" BorderWidth="1" HorizontalAlign="Center"
CellPadding ="2" CellSpacing ="1" visible="false" runat="server">
<asp:TableHeaderRow>
<asp:TableHeaderCell BackColor="AliceBlue" >Tag Name<br /><br /></asp:TableHeaderCell>
<asp:TableHeaderCell BackColor="AliceBlue" >Association Type<br /><br /></asp:TableHeaderCell>
<asp:TableHeaderCell BackColor="AliceBlue" >Tag Description<br /><br /></asp:TableHeaderCell>
<asp:TableHeaderCell BackColor="AliceBlue" >Tag Value<br /><br /></asp:TableHeaderCell>
</asp:TableHeaderRow>
</asp:Table>
<br />
<asp:Button ID="Submit" Text="Submit" OnClick="Submit_Click" Visible="false" runat="server" />
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
from c# code I'm building my table rows dynamicly:
while (rdr.Read())
{
trRow = new TableRow();
tcCell = new TableCell();
tcCell.Text = rdr["Label"].ToString();
trRow.Cells.Add(tcCell);
tcCell = new TableCell();
switch (rdr["ControlType"].ToString())
{
case "Text":
case "Integer":
case "Real":
TextBox ctrl1 = new TextBox();
ctrl1.ID = String.format("tagCtrl{0}" ,countTagsControls);
ctrl1.Text = "Test";
tcCell.Controls.Add(ctrl1);
//this.UpdatePanel1.ContentTemplateContainer.Controls.Add(ctrl1);
break;
.......
}
trRow.Cells.Add(tcCell);
PO_Tags.Rows.Add(trRow);
Then I'm trying to get the values of those controls:
TextBox txtCtl = (TextBox)UpdatePanel1.FindControl(String.format("tagCtrl{0}", i));
switch (rdr["ControlType"].ToString())
{
case "Text":
string v1 = txtCtl.Text.ToString();
break;
But it's not working!!
What I'm missing?!
Thanks in advance.