Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DropDownList selected value

Reply
Thread Tools

DropDownList selected value

 
 
Alan T
Guest
Posts: n/a
 
      07-05-2010
I think this is a basic question:

I got a dropdownlist bind with a datasource, how do I get the value of the
selected item?
eg.
Displayed text:

Andy (ID = 3)
Apple (ID = 1)
Candy (ID = 2)
John (ID = 5)
Mandy (ID = 4)


If I select John, then I need to get the 5.


 
Reply With Quote
 
 
 
 
Mr. Arnold
Guest
Posts: n/a
 
      07-05-2010
Alan T wrote:
> I think this is a basic question:
>
> I got a dropdownlist bind with a datasource, how do I get the value of the
> selected item?
> eg.
> Displayed text:
>
> Andy (ID = 3)
> Apple (ID = 1)
> Candy (ID = 2)
> John (ID = 5)
> Mandy (ID = 4)
>
>
> If I select John, then I need to get the 5.
>
>


You use the dropdownlist selected_indexed_changed event and the
dropdownlist.selected.value.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
get the selected value of the asp:dropdownlist in javascript Thierry ASP .Net 3 02-15-2010 08:43 AM
Selected ListItem in DropDownList does not appear selected Nathan Sokalski ASP .Net Web Controls 0 10-05-2008 10:29 PM
Selected ListItem in DropDownList does not appear selected Nathan Sokalski ASP .Net 0 10-05-2008 10:29 PM
DropDownList 2 always returns Selected = 0 for all items - even selected item Iain ASP .Net 3 12-11-2006 11:07 AM
dropdownlist in a datagrid - allow for no value to be selected Mark ASP .Net 1 11-07-2003 02:14 PM



Advertisments