.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

asp.net and dropdown lists

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :ASP.Net
I have an assignment that is way overdue and need some help in setting it up.  It says to have two additional dropdowns that allow selection of a telephone handset and a service plan adn this info comes from an access database.  Three check boxes should allow independent selection of the 3 additional options (which are voicemail, unlimited data, unlimited text) available.  I already tried doing this using but found that I would need to update all the fields in the database after the entries have been made.  Can someone please help me in setting this up?  I don't expect anyone to do it for me, just need some help with how to set it up.  This is from a class last spring and my memory is somewhat boggled.   Frantically frustrated :-(  

View Complete Post

More Related Resource Links

Gridview Editing with dropdown lists inside

  Hi, Any good  Example for Editable Grid with dropdownlist inside ? Getting some problem in updating the data   Thanks 

Reset button to change the value of dropdown lists



I have 4 dropdown lists adjacent to eachother that are only visible depending on the value of the preceeding dropdown. The dropdowns contain information relating to injuries and the plan is to make the users choose items from the dropdown list to define their injuries.

 - The first dropdown defines what kind of injury (laceration, bruise, break etc...)

 - The second defines where (arm, head, neck, finger)

 - The third defines further detail (left, right, N/A)

 - The last defines further detail again (upper, lower, N/A etc...)

I basically want a reset button that when clicked, resets the value's of these dropdowns to their initalvalue; '{Select}' (as i have a required field validator preventing '{Select'} from being the given value)

can someone please assist. I'd quite like the button to postback so that the change happens and the page refreshes and i need the validations to refresh also.

Alternatively is someone has a better approach feel free to let me know your thoughts. I don't have an current code as I haven't even been able to ge this working yet!

dropdown lists and selected value problem ?




I have dropdown lists within formview edit template


DD1 is binded to a Data table called Country Version  p/k = CountryId of type "Int"





DD2 is binded to Size Table p/k = SizeId of type Int and Foreign key of CountryId


The select Method of DD2 is "GetDatabyCountryID" which accepts selected value of DD1.


The problem is on postback I the DD1 reverts back to defualt settings and does not keep the selections

I made (for example countryId "1" SizeId  "3"


It seems that the Select Method GetDataByCountryId cannot find the SelectedValue of DD1


In the formview objectdatasource I have CountryId and SizeId from another table called profiles.


any advise appreciated







Using asp:dropdown lists to filter Gridview.


I'm trying to create a page with multiple fields to be used as parameters for filtering a GridView.  I'm using a combination of two asp:dropdown lists and two check boxes.   When I select a value in one ddl, I want to clear the value in the other ddl.  I was trying to use the event "onTextChanged" but that doesn't seem to fire off on the client side and I cannot seem to find any event for an asp:ddl or asp:checkbox or asp:radio button that fires off on the client side. 

Are there events, like onClientClick for asp:button, that fire on the client side for these controls when a selected value is changed or when the user clicks on them?

or do I need to use html controls instead?

Thanks for your help.

How to connect two dropdown lists


i have two dropdown lists and i would like if i select lets say "1" the second list returns "A""B" but instead it returns "A" only

so the question is how to make the second list display A"B when i select "1" from the first list

thank you

Cascade dropdown lists [Method Error 12030]


My first try with Ajax, followed step by step an example and i get in my dropdownlists "[Method Error 12030]"

I changed the script manager and used ToolkitScriptManager

 <form id="RegisterForm" runat="server">
        <asp:ToolkitScriptManager ID="MyToolkitScriptManager" runat="server"></asp:ToolkitScriptManager>

The dropdown:

 <asp:Label ID="CitizenshipLabel" runat="server" AssociatedControlID="Citizenship">Select citizenship:</asp:Label>
                                <asp:DropDownList ID="Citizenship" runat="server"></asp:DropDownList>
                                <asp:CascadingDropDown ID="CitizenshipCascade" runat="server" TargetControlID="Citizenship" LoadingText="Retrieving citizenships..."

Dropdown lists - showing items based on value


Hi, i have over 100 items all loaded in a dropdown list. They all are assigned a value between 1-10 which represent 10 categories.

When certain buttons are clicked, i want the dropdown list to display only items with a value "1" or "2", etc.

How can this be done?

Dropdown Lists and select all


Hi all,


I have a number of dropdown lists which are populated from a database.  They load depending on what the previous dropdown selection was so for example if the system was car based and I had chosen Ford then the next dropdown list would populate all cars made only by Ford.  What I'm wanting to do is add a select all to one of the dropdown lists.  Does anyone know how this would be done?  





Cascading dropdown lists, c#


Hi all,


I have several dropdown lists and each one is populated from a database depending on what was selected in the dropdown before. I have appended certain ones to have a select all.  I've the selected index changed to handle these.  All of this works fine when I carry out one search in the same session however when I go to carry out a second search in the same session and I choose another option, instead of displaying only the related items in the second dropdown it adds them at the bottom of the list underneath what was chosen in the last search.


Anyone have any ideas what is causing this?  I'm guessing it is something to do with how the page refreshes after the search button has been clicked and the results displayed in the grid.





Cascade dropdown lists in a repeating table (Browser-enabled form)


I am sure similar questions have been asked before...but:

I have a repeating table with 2 DDLs...let's say: state and city

city is currently sourced from web service which takes the value of the state as parameter.

I allow a user to add a new row in the repeating table to select another state ; and thus return related cities on the same row as the state..and so on...

The obvious question is: is that achievable without code-behind?  I have read about people using "current()" but it all seem to apply to the filter data which does not work for browser-enabled form....so should I use Web services at all?

Thanks in advance.


Cascading Dropdown lists



I have 2 DropDownLists and a Button on a simple aspx page.  connecting to an oracle database. The 1st DropDownList1 gets filled on page load.

When I select an item from the DropDownList1 the 2nd DropDownList2 get populated with the related records.

Here is the problem

The 1st DropDownList1 looses its selected item and moves the selection to the 1st item in the list.

here is the code for aspx page.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transit

Displaying SharePoint lists in Web Parts

When you create a built-in or custom list in Microsoft Windows SharePoint Services, Windows SharePoint Services creates a Web Part, a basic building block of a SharePoint site, to display that list. These Web Parts are called List View Web Parts. Windows SharePoint Services stores List View Web Parts in the site collection Web Part gallery. (The site collection Web Part gallery is the most central gallery of Web Parts for a work group. By default, the gallery name is the name of the site, such as "Our Team Site Web Part Gallery." )

SharePoint Tutorial - Lists

A list is a feature in SharePoint that stores a lists of information. For example, a list can be created to store web links in the human resources team site. A list is usually created for a specific type of information. Lists can contain metadata to describe the particular information in more detail and to make it easier to find.

Dropdown list in ASP.NET - How to get value selected

am sure this must be very simple, but unforunately I can't figure it out.
I have the following code which populates the dropdown lists from the database. This works fine. Now, when the user selects a particular employee name from the list, I want to get the Employee Id of the selected employee. i.e. I need to get the "Eid" value. I can do this if the EId is loaded in the dropdown list, but in this case only the employee name is displayed. Please let me know howI can get the Eid value even though it is not loaded in the dropdown list.
I would really appreciate your help

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

Binding an array to dropdown list


I have the following string which is a list of urls. How do I get this to work so the url shows for the selection and also is the value?      


allLinks = newAllLinks
        Me.DropDownList1.DataTextField = "Link"
        Me.DropDownList1.DataValueField = "LinkURL"
        Me.DropDownList1.Items.Insert(0, New ListItem(" - Select - ", 0))
        Me.DropDownList1.DataSource = allLinks


 ArgumentNullException: Value cannot be null.
Parameter name: container]
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +121
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName, String format) +8

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend