开发者

Visual web part dynamic controls findcontrol in dynamic created control not works

I have a problem with dynamic controls. In Button1 postback I created several TextBox controls like that:

TableCell c = new TableCell();
TextBox tb = new TextBox();
tb.ID = "RTB_"+re;
c.Controls.Add(tb);

On 开发者_运维技巧button2 postback I would like to get a thesis controls input data, but I did not get anything that could be a fault and of course I need rebuild these controls

foreach (string ctl in page.Request.Form.AllKeys)
{
    try
    {
        TextBox text = page.FindControl(ctl) as TextBox;
        if (text != null)
        {
            string t = text.Text;
        }
    }
    catch { }
}

How can I get and put new values in my controls?


I find solution in there http://techbrij.com/197/retrieve-value-of-dynamic-controls-in-asp-net

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜