Hi,Everyone
I have created textbox's dynamically. Now i want to read the textbox's values which are created dynamically. following is the code which i have written to create the textbox's dynamically:
Eveytime we don't know how many fields to be created,hence i used i used count variable to create the textbox's equal to the count.
for (int i = 0; i<;count; i++)
{
TextBox tb = new TextBox();
tb.ID = "tb" + i;
tb.EnableViewState = true;
Panel1.Controls.Add(tb);
}
from the above code, ID's for textbox's created as tb0,tb1,tb2 and so on...
while saving i don't know the exact number of textbox's now how can i read the textbox's values.
I used the following code to get the ID's of my textbox's in my submit button event but unable to get it:
for (int i = 0; i < Convert.ToInt32(ViewState["count"].ToString()); i++)
{
TextBox tb = new TextBox();
tb = (TextBox)Panel1.FindControl("tb" + i);
}
The values in my textbox's are comma seprated,how do i get this values individually.