Solved

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

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

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

14 Experts available now in Live!

Get 1:1 Help Now