DropDownList selected value

Discussion in 'ASP .Net' started by Alan T, Jul 5, 2010.

  1. Alan T

    Alan T Guest

    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.
    Alan T, Jul 5, 2010
    #1
    1. Advertising

  2. Alan T

    Mr. Arnold Guest

    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.
    Mr. Arnold, Jul 5, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    1
    Views:
    430
    Corey Wineman
    Nov 7, 2003
  2. Thierry
    Replies:
    3
    Views:
    106,648
    Corleone
    Feb 15, 2010
  3. Iain
    Replies:
    3
    Views:
    927
  4. Nathan Sokalski
    Replies:
    0
    Views:
    604
    Nathan Sokalski
    Oct 5, 2008
  5. Nathan Sokalski

    Selected ListItem in DropDownList does not appear selected

    Nathan Sokalski, Oct 5, 2008, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    289
    Nathan Sokalski
    Oct 5, 2008
Loading...

Share This Page