Solved

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

Posted on 2007-04-02
2
214 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

738 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