Hi,
how Create TextBox dynamically and how to retrieve text box value using asp.net and c#
How Create textBox dynamically and how to retrieve text box value
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Abhimanyu K VatsaRank #14 · 51.7K reputationPosted Nov 5, 2012, 2:49 AM EST
in the same way by using loop you can get the textbox data also.
Hemant SrivastavaRank #581 · 4.2K reputationPosted Nov 6, 2012, 9:30 AM EST
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