how to populate values in dropdownlist

Posted by Kneeta under Regular Expressions on 8/9/2010 | Views : 2298 | Status : [Member] | Replies : 2
how can i populate data into dropdown llist if i enter my value in textbox of same page




Responses

Posted by: Poster on: 8/9/2010 [Member] Starter

Up
0
Down
You can write following

dropDownList.Items.Add(new ListItem(txtBox1.Text, "valueOfTheItem"));


Here I am assuming that dropDownList is the name of your dropdown, txtBox1 is the name of your textbox.

Kneeta, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kneeta on: 8/9/2010 [Member] Starter

Up
0
Down
should i need to create table or simply .i need to populate data in dropdown list from textbox and when selecting the dropdown items too the value is dispayed in textbox

Kneeta, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response