selecteditem.value vs. selectedvalue

D

darrel

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
 
L

Lucas Tam

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 ; )
 
D

darrel

what is the difference between these? I always end up typing
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
 
B

Bruce Barker

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)
 
D

darrel

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top