selecteditem.value vs. selectedvalue

Discussion in 'ASP .Net' started by darrel, Aug 9, 2005.

  1. darrel

    darrel Guest

    what is the difference between these? I always end up typing 'selectedvalue'
    only to have problems and then realize I meant to use selecteditem.value
    (the value of the selected item).

    When would one use the former (selectedValue)?

    -Darrel
    darrel, Aug 9, 2005
    #1
    1. Advertising

  2. darrel

    Lucas Tam Guest

    "darrel" <> wrote in
    news::

    > what is the difference between these? I always end up typing
    > 'selectedvalue' only to have problems and then realize I meant to use
    > selecteditem.value (the value of the selected item).
    >
    > When would one use the former (selectedValue)?



    It just saves a step ; )



    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
    Lucas Tam, Aug 9, 2005
    #2
    1. Advertising

  3. darrel

    darrel Guest

    > > what is the difference between these? I always end up typing
    > > 'selectedvalue' only to have problems and then realize I meant to use
    > > selecteditem.value (the value of the selected item).
    > >
    > > When would one use the former (selectedValue)?

    >
    >
    > It just saves a step ; )


    So they are actually the same thing? Odd. I had problems with one but not
    the other recently. I'll have to go back and figure out what the culprit
    was...

    -Darrel
    darrel, Aug 9, 2005
    #3
  4. darrel

    Bruce Barker Guest

    SelectedValues returns the Value of the selecteditem or "" if there is none.

    SelectedItem returns the selected item. SelectedItem.Value return the .Value
    of the SelectedItem. SelectedItem.Value will throw an error if there is no
    selected item, because SelectedItem will return null, and .Value of null
    will throw the error.

    -- bruce (sqlwork.com)



    "darrel" <> wrote in message
    news:...
    > what is the difference between these? I always end up typing
    > 'selectedvalue'
    > only to have problems and then realize I meant to use selecteditem.value
    > (the value of the selected item).
    >
    > When would one use the former (selectedValue)?
    >
    > -Darrel
    >
    >
    Bruce Barker, Aug 10, 2005
    #4
  5. darrel

    darrel Guest

    > SelectedItem returns the selected item. SelectedItem.Value return the
    ..Value
    > of the SelectedItem. SelectedItem.Value will throw an error if there is no
    > selected item, because SelectedItem will return null, and .Value of null
    > will throw the error.


    aha! That explains the issues I was having. Thanks for that clarification!

    -Darrel
    darrel, Aug 10, 2005
    #5
  6. darrel

    Rustykool

    Joined:
    Jan 24, 2013
    Messages:
    1
    I agree with Darrel,that's exactly what it means...
    Rustykool, Jan 24, 2013
    #6
    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,714
    Antonio D'Ottavio
    Sep 19, 2005
  2. KathyB
    Replies:
    6
    Views:
    574
    Todd Thompson
    Jun 27, 2003
  3. Marina
    Replies:
    0
    Views:
    910
    Marina
    Aug 12, 2003
  4. VB Programmer
    Replies:
    5
    Views:
    8,063
    maysam
    Mar 11, 2008
  5. =?Utf-8?B?TkNaSU1N?=

    SelectedValue - SelectedItem

    =?Utf-8?B?TkNaSU1N?=, Dec 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,907
    Karl Seguin
    Dec 4, 2004
Loading...

Share This Page