Solved

dropdown-list variable

Posted on 2007-11-19
2
236 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 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