Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-04-02
2
Medium Priority
?
221 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 2000 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

610 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