473,508 Members | 4,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

selecteditem.value vs. selectedvalue

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
Nov 19 '05 #1
4 3460
"darrel" <no*****@hotmail.com> wrote in
news:ev*************@TK2MSFTNGP14.phx.gbl:
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 (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #2
> > 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
Nov 19 '05 #3
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" <no*****@hotmail.com> wrote in message
news:ev*************@TK2MSFTNGP14.phx.gbl...
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

Nov 19 '05 #4
> 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
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2122
by: Mike | last post by:
Hello, I have a web form with a Listbox. When trying to read the value of the last selected item with the statement below, I always get the first item, even if the user selected another item:...
3
2682
by: sling blade | last post by:
Hi, I have a dropdownlist in my DataList control and I am trying to set the SelectedItem property of the dropdownlist so when the datalist displays the user will see the text in the dropdownlist...
3
2050
by: Sam C | last post by:
Hi, I have an ASP.Net page which has a DropDownList on it. The DDL is populated via a method which is called from the Page_Load if IsPostBack = False. When the form is submitted the...
4
2088
by: Martyn Fewtrell | last post by:
I want to update a database record with a number of fields - doesn't sound to difficult at this stage! I have a system to select the correct record from the database and load the data into a...
7
11162
by: Ohad Asor | last post by:
Hello all, I have an ASP.NET page I've written using VS.NET2003, which have a ListBox in it. When I press a button in the form, I try to get the selected item in the list by calling...
3
11927
by: Alper ÖZGÜR | last post by:
Hi; I can read the selectedvalue of dropdownlist by javascript using this.value... How can i get the selectedItem.text by javascript?
0
958
by: clickon | last post by:
I want to use the selected value of a drop down list to filter a data source. When i have done this before i have used a DataSourceControl and i have just made the drop down a control parameter,...
1
1787
by: JP | last post by:
I have C# ASP.NET VS 2005 combo box set to perform an auto post back when the user changes the index protected void dropSSNEdit_SelectedIndexChanged(object sender, EventArgs e) { txtSSN.Text...
5
5690
by: Crazy Cat | last post by:
Hi all, I have combobox that is bound to a custom object collection thusly Dim collection As List(Of StructureType) = StructureType.FindStructureTypes(SharedObjects.StructureTypes,...
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.