You won't find the dynamically created control itself by the FindControl method as it is not preserved between postbacks. But you can find the VALUE of the dynamicallt created TextBox, that is the text in it, in the Request.Form collection.
If you loop through the Request.Form collection, you will find the value, i.e. the text, in the textbox:
for (int i = 0; i < Request.Form.Keys.Count; ++i)
{
Response.Write(Request.Form[i]);
}
mm10
Contributor
6409 Points
1184 Posts
Re: how to get value from dynamic created text box
Apr 04, 2012 03:17 PM|LINK
You won't find the dynamically created control itself by the FindControl method as it is not preserved between postbacks. But you can find the VALUE of the dynamicallt created TextBox, that is the text in it, in the Request.Form collection.
If you loop through the Request.Form collection, you will find the value, i.e. the text, in the textbox:
for (int i = 0; i < Request.Form.Keys.Count; ++i)
{
Response.Write(Request.Form[i]);
}