| Author: pradeep kumar reddy 04 Nov 2009 | Member Level: Silver | Rating:  Points: 2 |
hi deepa, first we have to configure the dropdown list with the database. then we can access the data srom the database. now coming to your question u want to access data to the textbox when u click on update button. for this try the following code.
protected void button1_click() { foreach(listitem s in dropdownlist1.items) { if(s.selected) { textbox1.text=s.text; } } }
try this code. and donot enable auto postback. because if u enable means then the selected item in dropdownlist automatically comes into the textbox irrespective of button click
|
| Author: Hitesh Prajapati 04 Nov 2009 | Member Level: Silver | Rating:  Points: 2 |
foreach(listitem s in dropdownlist1.items) { grid.item.insert(new insert item(s,"0")); }
|