SelectedValue - SelectedItem

Discussion in 'ASP .Net' started by =?Utf-8?B?TkNaSU1N?=, Dec 4, 2004.

  1. what is a selected value and what is a selected item? I am constantly
    guessing and all the information I have found says SelectedItem is the item
    selected and SelectedValue is the value selected. These answers leave me
    chasing my tail.

    Thanks

    nczimm
     
    =?Utf-8?B?TkNaSU1N?=, Dec 4, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?TkNaSU1N?=

    Karl Seguin Guest

    SelectedItem returns the ListItem object. SelectedValue simply returns the
    string value. SelectedValue is the same as SelectedItem.Value. Also,
    SelectedValue is read/writable, whereas SelectedItem is readonly. You can
    safely use SelectedValue, unless there's a reason you need the entire
    ListItem that was selected (99% of the time you only use the value).

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "NCZIMM" <> wrote in message
    news:...
    > what is a selected value and what is a selected item? I am constantly
    > guessing and all the information I have found says SelectedItem is the

    item
    > selected and SelectedValue is the value selected. These answers leave me
    > chasing my tail.
    >
    > Thanks
    >
    > nczimm
     
    Karl Seguin, Dec 4, 2004
    #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. Antonio D'Ottavio
    Replies:
    1
    Views:
    2,748
    Antonio D'Ottavio
    Sep 19, 2005
  2. Marina
    Replies:
    0
    Views:
    1,206
    Marina
    Jun 25, 2003
  3. Jos Branders
    Replies:
    6
    Views:
    13,112
    William F. Robertson, Jr.
    Jun 25, 2003
  4. Marina
    Replies:
    0
    Views:
    950
    Marina
    Aug 12, 2003
  5. darrel
    Replies:
    5
    Views:
    16,348
    Rustykool
    Jan 24, 2013
Loading...

Share This Page