Solved

dropdown-list variable

Posted on 2007-11-19
2
235 Views
Last Modified: 2013-12-17
There is a dropdown list control (aspx page)

DropDownList_Title_ID   (databound to sql server for dynamically generating list content)

pulling back these x2 fields:    TitleName  (string),  Title_ID (int)

I can get the selected item value (int) by using: DropDownList_Title_ID.Text   .... but how do I pull the equivalent TitleName field (i.e. the selected dropdown item).  Want to transfer the TitleName value into a string.

Your time and efforts with enquiry are much apprieated.
0
Comment
Question by:amillyard
2 Comments
 
LVL 21

Accepted Solution

by:
surajguptha earned 500 total points
ID: 20315849
Usually the drop down's primary key is bound as the the value member and the title is bound as display member. Selecteditem.value would give the ID and the selectedItem.Text would give the title.

You can try doing that or you could get the title from the data reader/ list you are binding to the dropdown by iterating to see what title has the Id selected
0
 

Author Comment

by:amillyard
ID: 20316438
surajguptha:

thank you for clarifying that -- just what I needed to know.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with retrieving partial value from a column using VB.NET 4 42
SlingPlayer alternatives 1 31
DataGridView Events ? 3 37
Syntax error 9 45
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now