Solved

dropdown-list variable

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

19 Experts available now in Live!

Get 1:1 Help Now