hello im creating textboxes and their number depends on the contents of a dropdownlist.
now i want to retrieve the data from these textboxes. but my approach is not clearCode:protected void dropDownList_SelectedIndexChanged(object sender,EventArgs e) { int number=int.parse(dropdownitem.Text); for(int i=0;i<number;i++) { TextBox tb=new TextBox(); tb.ID="tb"+i.ToString(); Panel1.Controls.Add(tb); //placing the textboxes on a panel } }
this is definitely not working.can you suggest something that serves my purpose? thanks in advanceCode:protected void button1_Click(object sender,Eventargs e) { for(int i=0;i<Request.Form.Count;i++) { string strid="tb"+i.ToString(); string value=Request.Form[strid].ToString(); } }




Reply With Quote