.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

cascading dropdown

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :ASP.Net

Hello all,

I am brand new to ASP.net &  Ajax, and have been stuggling with this problem for the last two days....

I am using the ASP.net AJAX video http://www.asp.net/ajax/videos/how-do-i-use-the-aspnet-ajax-cascadingdropdown-control-extender to get a cascading dropdown to work in my ASP.net Web Application, but the dropdown boxes are empty!

As far as I can tell, I am using the example exactly same....

Please help in figure out what I could be doing wrong? All the 3 drop downs are empty....! 

Thanks a lot



Here is my code:





<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" EnableEventValidation="false" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <script runat="server">

View Complete Post

More Related Resource Links

Issue in Infopath 2007 browser form - cascading dropdown using owssvr.dll filter view


Referring the below link, I created a cascading dropdown. The parent dropdown has sharepoint list as datasource and the child dropdown has xml datasource that points to owssvr.dll filter view. The cascading drop down works fine in preview but throws error after publishing as admin approved form - "form cannot run the specified query" exception when trying to execute xml datasource i.e., when a value is selected in parent dropdown. The security is 'Full Trust". In the event viewer the error message states "401 unauthorised" for the user a/c. the xml data source is an approved udcx file and in central admin, have enabled cross domain for infopath service. I have tried different solution provided in tech forums but issue still exists. Not sure whether Im missing something. Can someone guide me in fixing this issue?

Link Reffered:



Cascading Dropdown Question



I have 2 parent child cascading dropdowns on my form. At present they work as normal so you can only select a value from the second once you've selected one from the first, otherwise it's disabled. Is it possible to show all values in the second if you haven't selected anything from the first? Does that make sense?


How to return back back to code behind file after cascading dropdown calling

Hi, I have a cascading dropdown. After the dropdown is populated(it is in another file)  i would like to return back to the original form where the control is placed. is there anyway of doing it

Adding group header in the cascading dropdown

Hi,   I have a cascading drop down, and in one of the dropdown i want to add a group header.    i,e suppose if i list the names (of girls and boys) i want to group them in a dropdown say(Girls and Boys as header under them the names)   Girls aaa bbb ccc Boys ddd gggt   Can anybody please help me

How to disable Cascading Dropdown with selected value?

Hi I have a RadioButtonList and two cascading dropdown linked to corrspoding dropdown control. Based on radiobutton's selection, the cascading will be prepopulated with some values and one value is selected in both dropdown. I want to disable the cascading dropdown/dropdown after values are filled and selected on selection of radiobutton selected in RadioButtonList. I tried to disable it, but in that case dropdown is getting empty. Please advise, how to do this. Thanks in advance.  

ASP.Net Dynamic Data - DropDownList Field Template with AJAX Cascading DropDown Extension

Hi all,   Have spent hours trying to create a Dynamic Data Field Template holding a DropDownList which is extended by the AJAX Cascading DropDown extension. Final form holds multiple cascading dropdown boxes. User selects Country (Land) then Postcodes, Counties (Provincie) are populated. Once postcode is selected then towns (Plaats) are populated.  The problem I am now facing is that the viewstate for the dropdown lists is not being saved/restored after an insert action or custom validation error. So basically the dropdown lists are being reset to their default values. Some code (if missing parts, just ask and I will post them) - Don't mind the code structures etc... needs some refactoring :) Attribute I created:using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Data { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] sealed public class CascadingDropDownParametersAttribute : Attribute { //public string TargetControlID; // The ID of the DropDownList to populate. public string Category; // The name of the category this DropDownList represents. public string PromptText; // Optional text to display before the user has selected a value from the DropDownList. public string

Cascading Dropdown Web Method Issue



I am having an intersting issue to which I have found no solution, obviously. I am using a web service to populate a couple cascading drop downs. Evereything looks correct to me but I am getting a [Method Error 500] when I run it all. I have the <System.Web.Script.Services.ScriptService()> added to the web service so that's not the problem. What I have found while playing with it is that if I remove the arguments from the web method (ByVal knownCategoryValues As String, ByVal category As String) then it works. This of course is not helpful as I am trying to populate multiple drop downs. I can find nothing on anyone else having this issue.

I am using .NET 3.5 and Ajax DLL version 3.02... 

Also of note is that I have another website, using the same .NET and Ajax versions and this code is working fine.

I have tried everything I can think of, including my last resort tactic of smashing my face on my keyboard, and nothing is working. I am at a loss. Any help would be appriciated. Thanks.

Drop Downs:

<asp:DropDownList runat="server" ID="ddlPlateType" Width="250px" />

<ajax:CascadingDropDown runat="server" ID="cddPlateType" TargetControlID="ddlPlateType"

Method error 500 on cascading dropdown


Why do I get a method error 500 on this code:

<asp:DropDownList cssclass="textbox" ID="ddlCountry" runat="server" />
<asp:RequiredFieldValidator Display="Dynamic" SetFocusOnError="True" ID="rfvCountry" runat="server" ControlToValidate="ddlCountry" ErrorMessage="*" InitialValue=""/>
<cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" TargetControlID="ddlCountry" Category="Country"
    prompttext="Select country" ServicePath="/LocalCities.asmx" ServiceMethod="GetCountries">

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class LocalCities
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function GetCountries(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameVa

Infopath 2007 cascading dropdown through coding



Can anyone suggest me the Infopath cascading dropdowns. I need to create one form ...it will have 3 dropdown and based on the users selection in the first dropdown 2nd dropdown should display only one item (out of 3 standard items..users dhould see only one item int he dropdown). based on the user's selection wrd dropdown should show 2 items (out of 5 standard items....users should see some items only based ont he first dropdwons selected value). Can anyone one suggest how to accomplish this?. Thanks in advance to all.

Deploying a Cascading Dropdown in Browser Forms


The article on using WebService to implement browser enabled cascading dropdown works well.  But what about its deployment?  If we need to move this from one environment to another, then we need to recreate Data Connections to point to the WebService location and also setup field Rules once again in the target environment.

Just imagine if there are many forms with many drop-down cascading lists...  Is there any way to minimize the load on Administrator to recreate Data Connections and Rules?

Thanks & Regards,
Kamlesh | Blog | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.

Cascading Dropdown and Triggering Events


I have a big form wrapped in an updatepanel (for other reasons).

Inside this form is a section that needs to have it's own asynchronous postback -- there is a cascading dropdown and, based on the selections, you can add a product to a list.  Once that list is populated, it can be submitted with the rest of the form. 

So in this little section I have :

  • A Label for testing the button event (the label gets updated)
  • 5 Cascading Dropdowns (which are working fine)
  • A button

The button event changes the label text.  If I click the button right away, it updates the label as expected.  However, if I click the button *after* doing any selections on the Cascading Dropdowns, the label does not get updated. 

Things I have tried:

  • Removing the updatepanel surrounding the form -- yes, then the event gets fired, but I need it all in the updatepanel.
  • Adding UpdateMode=Conditional -- no change
  • Adding an update panel just around this section -- no change
  • Adding Triggers either to the big updatepanel or to one just around this section -- no change


Cascading Dropdown list boxes



I'm developing a Browser-enabled InfoPath 2007 form which uses code. I have a requirement to get infomation from a sharepoint list column and populate in the 1st drop down list. Depending on the users selection on the 1st drop down, need to populate the 2nd list which will get data from the same list from a different column. BAsically filter data from the first selection.

I got to know that filtering data with out code is not possible in browser-enabled web forms. Is there a work-around for this ? Can the lists be populated using code ?

Thanks in advance !

Cascading dropdown not posting back even though autopostback=true?


I have the following code:

<asp:DropDownList ID="ddlCountries" AutoPostBack="true" runat="server">
<cc1:cascadingdropdown ID="cddCountries" runat="server" Category="Country" Enabled="True" LoadingText="loading" PromptText="choose country"
    ServiceMethod="GetCountries" ServicePath="geolocation.asmx" TargetControlID="ddlCountries">

code behind
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub

Private Sub ShowSearchResults()

End Sub

Why is the ShowSearchResults method not called when I change a value in the ddlCountries dropdown, even though I have autopostback="true" on it.

Invalid postback or callback argument (using Cascading dropdown list controls)



i use cascading dropdown lists (in a user registration form) and when the user hits the submit button i get the error:

"Invalid postback or callback argument"


I've seen on the net that this is a problem dating back many years but still haven't found a solution to this.

 I've read about changing EnableEventValidation to false, but this poses a security risk.


Anyone knows a good solution to this? (i'm coding in c#)




Ajax Cascading Dropdown - no data



I have been trying to get started with Ajax Toolkit and have started with the Cascading Dropdowns. I am following this tutorial: http://www.nerdliness.com/article/2008/02/15/using-asp-net-ajax-cascadingdropdown-visual-basic-and-database

But I cannot my dropdown lists to populate with any data. The only difference from the tutorial code is that I am connecting to different tables (but I have tested each query to make sure it returns data).

I have no idea where to start trying to fix this issue. Any help is appreciated

Help with opening PDF from SQL05 Database from AJAX cascading DropDown



I am new to ASP.NET and AJAX. I have recently viewed the video tutorials on the Cascading Dropdowns, and applied that to my website. I am populating the dropdowns from 3 tables, and am wondering how i would be able to open pdf file from the sql database and display it in the browser. Can anyone provide me any suggestions? Thanks to all

How to call the server method After the Cascading dropdown populated


i'm using the Ajax cascading dropdown list it works fine. But how to call the server side after the dropdown list populated....

i don't want to call those method in drop down list index changed because it may cause postback.......

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