473,378 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Text value of Dropdown.

How do you get the selected text of a dropdown box? Selectedvalue will get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).

Thanks,

Tom
Nov 19 '05 #1
9 1624
Hi tshad,

Try this:

yourDropDownList.SelectecItem.Text

Guillermo G.

--------------------------------------------------------------------------------
Guillermo González Arroyave :: MCP ASP.Net C# :: DCE4

"tshad" <ts**********@ftsolutions.com> wrote in message news:Ol**************@TK2MSFTNGP14.phx.gbl...
How do you get the selected text of a dropdown box? Selectedvalue will get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).

Thanks,

Tom
Nov 19 '05 #2
d1.SelectedItem.Text;

"tshad" wrote:
How do you get the selected text of a dropdown box? Selectedvalue will get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).

Thanks,

Tom

Nov 19 '05 #3
Is DropDownList.SelectedItem.Value what you're looking for?

-Brock
DevelopMentor
http://staff.develop.com/ballen
How do you get the selected text of a dropdown box? Selectedvalue
will get you the value and selectedindex will get you the position,
but how do you get the text (it isn't selectedText).

Thanks,

Tom


Nov 19 '05 #4
> Is DropDownList.SelectedItem.Value what you're looking for?

Oh! Indeed, DropDownList.SelectedItem.Text is what you're after. :S

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #5
Hi tshad,

Try this:

yourDropDownList.SelectecItem.Text

Guillermo G.

--------------------------------------------------------------------------------
Guillermo González Arroyave :: MCP ASP.Net C# :: DCE4

"tshad" <ts**********@ftsolutions.com> wrote in message news:Ol**************@TK2MSFTNGP14.phx.gbl...
How do you get the selected text of a dropdown box? Selectedvalue will get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).

Thanks,

Tom
Nov 19 '05 #6
d1.SelectedItem.Text;

"tshad" wrote:
How do you get the selected text of a dropdown box? Selectedvalue will get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).

Thanks,

Tom

Nov 19 '05 #7
Is DropDownList.SelectedItem.Value what you're looking for?

-Brock
DevelopMentor
http://staff.develop.com/ballen
How do you get the selected text of a dropdown box? Selectedvalue
will get you the value and selectedindex will get you the position,
but how do you get the text (it isn't selectedText).

Thanks,

Tom


Nov 19 '05 #8
> Is DropDownList.SelectedItem.Value what you're looking for?

Oh! Indeed, DropDownList.SelectedItem.Text is what you're after. :S

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #9
"HARI PRASD BARU" <HA***********@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
d1.SelectedItem.Text;
That was it.

I can never seem to remember that when I need it.

I never understood why you have a SelectedValue, but not a SelectedText.

Thanks,

Tom
"tshad" wrote:
How do you get the selected text of a dropdown box? Selectedvalue will
get
you the value and selectedindex will get you the position, but how do you
get the text (it isn't selectedText).

Thanks,

Tom

Nov 19 '05 #10

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

Similar topics

20
by: Dannyboyo | last post by:
I have what I hope is a simple request. I can't really code in javascript, but I am pretty good at cusomizing it with slight modifications. I code in ASP and HTML. I am trying to capture customer...
2
by: Corepaul | last post by:
As input is typed into a text box, I would like to search a recordset for the first record that matches what has been typed so far. I would like to update the text box to display the letters typed...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
6
by: Charleees | last post by:
Hi all, I have a DropDown and a TextBox just bekeow it... I have to get the selected value from dropdown and set it as textBox Text.. The thing is i have to do this Without PostBack..... ...
6
by: suresh Chowdary | last post by:
Hi All, depending upon text box entry i want to show drop down box with respective values. means if user enters 'ls' in the text box i want to show the values like 'she','he' in dropdown box it...
16
by: mj.redfox.mj | last post by:
Can anyone help? I have a textbox which I'm programatically adding by using the following code: txtTest = New TextBox txtTest.ID = "txtLeft" + cntCount.ToString...
3
by: bhanubalaji | last post by:
hi, I am unable to disable the text(label) in javascript..it's working fine with IE,but i am using MOZILLA.. can any one help regarding this.. What's the wrong with my code? I am...
18
by: Academia | last post by:
I let the use modify the text of a combobox and then I replace the selected item with the new text (in Keyup event). But if he sets the Text property to an empty string ("") that sets the...
2
by: GArlington | last post by:
"G. Morgan" <no_em@il.invalidwrote in message news:8787770faf30b1bd48f393baa1a89fdbnp@mypost.invalid... <snap> <snap> Did you try <cr><lf combination? ** Posted from http://www.teranews.com...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.