Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

dropdown-list variable

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 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