Retrieve Value from TextBox Which is created in the code behind
-
Hi Guys Need Help. I am using a dynamic created Textbox in code behind However when i wanna retrieve the value from the Textbox which i have created, I always seem to hit an error and stuck at the part of retrieving value Any sample or advise will be a blessing to me Thanks A Millions
KaKaShi HaTaKe
-
Hi Guys Need Help. I am using a dynamic created Textbox in code behind However when i wanna retrieve the value from the Textbox which i have created, I always seem to hit an error and stuck at the part of retrieving value Any sample or advise will be a blessing to me Thanks A Millions
KaKaShi HaTaKe
You add the textbox using
Controls.Add()
. When creating the textbox from codebehind, you can assign it an ID say, tbDynamicId.TextBox tb = new TextBox();
tb.ID = "tbDynamicId";
this.Controls.Add(tb); //To add the the current formThen you can get the textbox like:
TextBox tbDynamic = (TextBox)FindControl("tbDynamicId");
And then retrive the value normally,
String value = tbDynamic.Text;
-
Hi Guys Need Help. I am using a dynamic created Textbox in code behind However when i wanna retrieve the value from the Textbox which i have created, I always seem to hit an error and stuck at the part of retrieving value Any sample or advise will be a blessing to me Thanks A Millions
KaKaShi HaTaKe