/* my Repeater ItemDataBound */ int i = 1; for(int i = 1; i <= 24; ++i) { double qtd = com.STRTODOUBLE(HI.ToString()); TextBox txtQTD = new TextBox() { ClientIDMode = ClientIDMode.Static, ID = e.Item.ItemIndex.ToString() + "_" + i.ToString(), CssClass = "form-control text-center h5 small", MaxLength = 12, Text = qtd.ToString("n1"), Enabled = false }; HtmlTableCell htc = new HtmlTableCell(); htc.Attributes.Add("class", "text-right"); htc.Controls.Add(txtQTD); tr.Controls.Add(htc); ++i; } /* my Repeater ItemCommand */ ... if (e.CommandName.ToString() == "HSG") { for (int i = 1; i <= 24; ++i) { /* I can access any control that was added in the aspx page, but the dynamic control below always returns null value */ TextBox txtQTD = (TextBox)e.Item.FindControl(e.Item.ItemIndex.ToString() + "_" + i.ToString()); txtQTD.Enabled = true; ++i; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)