Hi,
how Create TextBox dynamically and how to retrieve text box value using asp.net and c#
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hemant SrivastavaPosted Nov 6, 2012, 2:30 PM
TextBox oTextBoxDynamic = null;
private void Form1_Load(object sender, EventArgs e)
{
oTextBoxDynamic = new TextBox();
Point textBoxLocation = new Point(77, 169);
oTextBoxDynamic.Location = textBoxLocation;
this.Controls.Add(oTextBoxDynamic);
}
and for retrieving the text value from the text box, just use the text property of the text box:
String s = oTextBoxDynamic.Text;
If it helps, Please mark it as an accepted answer.
Thanks,
Hemant
Abhimanyu K VatsaPosted Nov 5, 2012, 7:49 AM
in the same way by using loop you can get the textbox data also.