Jump to content

DropDown To listbox


LJnel

Recommended Posts

page.aspx:<body>	<form runat=server>	<asp:DropDownList ID="ddl" Runat=server>	<asp:ListItem Value="1">value1</asp:ListItem>	<asp:ListItem Value="2">value2</asp:ListItem>	<asp:ListItem Value="3">value3</asp:ListItem>	<asp:ListItem Value="4">value4</asp:ListItem>	<asp:ListItem Value="5">value5</asp:ListItem>	<asp:ListItem Value="6">value6</asp:ListItem>	</asp:DropDownList>	<br /><br />	<asp:Button ID="btn" Runat=server Text="Submit"></asp:Button>	<br /><br />	<asp:ListBox ID="lb" Runat=server Width="100"></asp:ListBox>	</form>	</body>page.aspx.vb:Protected Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn.Click        lb.Items.Add(ddl.SelectedItem.Text)    End Sub

This is just a very basic code, what this does is when you select a value in the dropdownlist and click submit the value is added in the listbox

Link to comment
Share on other sites

:) thank you VERY much, ill try it and come back to ui have this project that my lecturer wants, i am on my own and new to asp.netand the project is a web app that the whole department wants to use, i amscared that i will not get it done in time.. so i will come here alot..i live in south africa, do u live here as well?thx louis
Link to comment
Share on other sites

Yes feel free to come here often with questions. I have been using ASP.Net for over 2 years now and love it. It is more efficient, faster, and cleaner than ASP and PHP.BTW, I live in Canada...a bit of a stroll (and a swim) from you :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...