Solved

get the values from the DropDownList(S) in C# codebehind from the tables

Posted on 2007-04-02
2
213 Views
Last Modified: 2013-11-27
EASY QUESTION...i am using ASP.NET/C#

My question is how do i get the values from the DropDownList(S) in C# codebehind from the tables?

Below is a snip of code:

 <table style="width: 323px; border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid;">
            <tr>
                <td colspan="3">
                    <span style="font-size: 10pt">Close Calendar Schedule Reminders</span></td>
            </tr>
            <tr>
                <td style="width: 1px; height: 24px;">
                    <asp:DropDownList ID="DropDownList1" runat="server">
                    </asp:DropDownList></td>
                <td style="width: 31px; height: 24px">
                    <asp:DropDownList ID="DropDownList2" runat="server">
                    </asp:DropDownList></td>
                <td style="height: 24px;">
                    <asp:LinkButton ID="LinkButton1" runat="server" Font-Size="10pt">Insert</asp:LinkButton></td>
            </tr>


0
Comment
Question by:joan2006
[X]
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
2 Comments
 
LVL 3

Expert Comment

by:emailrobertwalker
ID: 18838863
You used the word "from" twice in your question, so it is dificult to understand what you need the data from.

Can you restate it?
0
 
LVL 12

Accepted Solution

by:
ShazbotOK earned 500 total points
ID: 18838952
I am going to assume you have populated the DisplayText AND the DisplayValue with a datasource so here you go:
//when user selects the dropdown and a postback event occurs...
         string selectedVal1 = DropDownList1.SelectedValue;
         string selectedVal2 = DropDownList2.SelectedValue;
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

756 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