.NET combobox question

Posted on 2012-08-17
Last Modified: 2012-08-19
I was wondering with a combobox if you have a value and a display like in HTML

<option value="databaseFirstNameField">First Name</option>
<option value="databaseLastNameField">Last Name</option>
<option value="databaseTelephoneNameField">Telephone</option>
<option value="databaseEmailNameField">Email</option>

Open in new window

if not how would I do this in .NET its a small search engine for customers so first you select to search by Name, telephone, email etc etc and then enter the keyword

then my query would be something like:

Question by:prowebinteractiveinc
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    Yes, the ComboBox has the SelectedText and the SelectedValue properties which will give you the respective data.

    Author Comment

    ok but how do I define that in the combobox ?
    LVL 9

    Accepted Solution

    <option value="L2B">Background - Column 2</option>
    <option value="TBD">Background - Column 3</option>
    this is in the html

    and SelectedText /SelectedValue  are using in c# code the code behind page code to check the selected item value /text.

    comboboxName.selectedText have the value for selected combobox option.

    Author Comment

    I dont think im being clear on what I need

    How do I populate the combobox with Values and displays ?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    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…
    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    This video discusses moving either the default database or any database to a new volume.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 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

    15 Experts available now in Live!

    Get 1:1 Help Now