Solved

dropdown-list variable

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

726 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