Click here to Skip to main content
15,910,471 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to the project.please kindly help me.My doubt is for example i had created a form like name,address,gender(using radio buttons),courses offered(using drop down list).and empty list box placed.and submit button.when i click on submit button that name,address,selected gender,selected course has to display in the given listbox.
Posted

1 solution

Hi
Try the following

your listbox id.Items.Add(your dropdownlist(s)id(s).SelectedItem.Text);


If you want to add items with both text and value then try the following

ListItem li = new ListItem(ddlTest.SelectedItem.Text, ddlTest.SelectedItem.Value);
            
            lboxTest.Items.Add(li);


Hope this helps..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900