how to get SELECTED VALUE of parent dropdownlist to target dropdownlist using cascading

Hi All,

I am using C# , asp.net2.0 , Ajax1.0

i am filling dropdownlist using cascading ajax extender. i taken help of ajax site and build a code to fill the control.

my question is how do i get parent selected item value. my web service code to fill target value

CascadingDropDownNameValue[] GetProd(string knownCategoryValues , string category)


StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);

//string subgrp ;

//int sub1;

//if (!kv.ContainsKey("Prod") || !Int32.TryParse(kv["Prod"], out sub1))

//// if (!kv.ContainsKey("Prod"))


// return null;



SPGETPRODUCT_GIVENSUBTableAdapter prd = new DsprdTableAdapters.SPGETPRODUCT_GIVENSUBTableAdapter();

Dsprd.SPGETPRODUCT_GIVENSUBDataTable prdgrp = prd.GetProd(kv["Prod"]);

List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();foreach (DataRow dr in prdgrp)


new CascadingDropDownNameValue((string)dr["PM_PRD_NAME"], dr["PM_PRD_CODE"].ToString()));


return values.ToArray();


This is giving me no out put as kv["Prod"] is showing null value.

Cascading code in aspx is

<ajaxToolkit:CascadingDropDown ID="cddPROD"
                                       PromptText="Choose a Product...."
                                       LoadingText="Please wait ..."
                                       ServiceMethod="GetProd" />

 Please Suggest
4/16/2008 4:10:47 AM 91979 articles. 4 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 43


This forum for AJAX will be better for you.

Vince Xu
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
4/17/2008 6:07:29 AM

Similar Artilces:

How Select one dropdownlist value using down arrows corresponding other dropdownlist value are select
I am using two dropdownlist box.One is used for country selection. other one is used for state selection.I am using dropdown selectedindexchanged event. when i click country dropdownlist corresponding state is selected in state dropdownlist box. How select the country in country dropdownlist using down arrow keys at the same time corresponding state is select in state dropdown list.R.Karthikeyan   kartmca: How select the country in country dropdownlist using down arrow keys at the same time corresponding state is select in state dropdown list.Generally, we don't implmenet...

get the selected dropdownlist value by using FindCONTROL??
Hi, I am wondering how to get the selected value from difference dropdownlists?? I inserted rows dynamically with dropdownlist for each row. I also assigned ID for the dropdownlist. Now, I need to get ALL the selected dropdownlist value by finding the associated ID. But doesn't seem succcess. Please advice. Related code as below: ===================================== for (int i = 0; i <= ListTable1.Items.Count - 1; i++) { // Add selected web profile to cell1 TableRow tRow = new TableRow(); TableCell tCell = new TableCell(); Table1.Rows.Add(tRow); tRow.Cells.Add(tCell); tCell.Text...

How to take selected value of dropdownlist in web method using cascading dropdownlist
Hi All,I am using C# 2.0 and ajax1.0.I am trying to fill dropdownlist using ajax cascading toolkit but I am not able to populate the dropdownlist.  My question is how do I take input value of parent dropdownlist in web service the fill the data that is in my senario I have subprod parent (fill on page load) and then Prod fill on subprod selection.  The web service method I used is  public CascadingDropDownNameValue[] GetProd(string knownCategoryValues, string category) { StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(known...

how to get selected the value of cascading Ajax dropdownlist extendar control after postback.
how to retain value of dropdown list after postback which is extended by ajax cascading dropdownlist extendar. thanks in advance.     Hi, Can you further elaborate your problem? your retain value is for nxt drop down list? how many drop down list you have? normally what we trying to retrieve value from selected dropdown value is Label1.Text=DropdownList1.selectedValue :) Regards, Hideyoshi, hi,i have 2 Ajax dropdownlist Which is filed through web service. one filter the other.the second dropdown has value <-All->,a,bwhen i select a and cl...

on selecting country from one dropdownlist ...states of selected country is not getting populated in second dropdownlist
 hi iam having a dropdownlist which loads the country names on page problem is wen i select india the corresponding states are not coming in another dropdownlist my code isi have two tablescountryname:countryid identity,countrynamestatename:stateid identity,statename SqlConnection cn = new SqlConnection(ConfigurationSettings.AppSettings["con"].ToString());       protected void Page_Load(object sender, EventArgs e)    {                   &...

how to get the values from cascading dropdownlist
I created dropdowns at runtime.for implimentation of cascading I written webservice.Now how to get values from cascadings.when i click on save button dropdowns r created in pageload event and selected value is taking as to persist those values.thanks  try this. This SHOULD BE CONVERTED TO STRING dropdownlist1.selected value.ToString() I tried with all the properties cascadingdropdown list but not yet getthanks  Hi Bhagyam, When your DropDownList control is associated with CascadingDropDownExtender, the selected value just like you did above won't take the effe...

Getting The Selected Value of a DropDownList
I have a DropDownList that is populated with selections from a database on the page load event. It displays fine with all the correct values, BUT there is a problem when I try to process its data. I eventually reference the DropDownList during a button's server click event. I want to know which value is selected, and I am trying to do so with a call to: DropDownList.SelectedItem.Value; The problem is that such a call is alway referencing the first item of the list, not the one the user selects. What am I doing wrong? In your page load event handler do you put data bind code ins...

Getting Selected Value from DropDownList
Hi All, I'm trying to get a selected value from a dropdownlist after a submit button is pressed but keep getting the following error: Object reference not set to an instance of an object (that old chestnut!) Ok, here is the way my code is set up: I have a control called Attributes (Attributes.ascx and Attributes.ascx.vb) Attributes.ascx Here I have a dropdownlist whose id is "DataDownTest". Attributes.ascx.vb Here I have, amongst other things, this code: Protected WithEvents DropDownTest As System.Web.UI.WebControls.DropDownList Public ReadOnly Proper...

get the row element values using row index for dynamic dropdownlist using javascript
Friends,How to get the row element values using row index for dynamic dropdownlist using javascript ?Thanks in advance  I want creating dynamic dropdownlist  using javascript. I am working on deleting a row. function DeleteRow(r) { var i = r.parentNode.parentNode.rowIndex;document.getElementById("ctl_Contentmain_tbldynamic").deleteRow(i);var str = document.getElementByName("ddljobs");   alert(str); } Check out this. var str = document.getElementById('<%=ddljobs.ClientID%>');   Thanks,santosh_maharajaPlease mark as answer ...

Getting DropDownlist's DataTextValue Selected Value Given the SelectedValue and/or Selected Item
In the codebehind, I need to extract something from the Text (displayed) value of dropdownlist's selected item and I have  the SelectedValuand and SelectedItem in hand. How can I do this?  FindControl? Item? row?   Thanks. Well, its easier than you might think. SelectedItem has a "text" property. Thats the selected text right there :)  If you need the Text of the selection, then you have to use the SelectedItem.Text property.  If you want the value (not the displayed text) the you can directly use the SelectedValue. dim sText as String = dropdown...

getting the selected value of a dropdownlist with javascript
How can i obtain the selected value of a dropdownlist using javascript ? Ive tried the following method, but the javascript function never gets called this is in the page_load in the codebehind file of the aspx page DropDownList ddlTaskFrequency = (DropDownList)ctrlTaskMonitor.FindControl("DropDownListTaskFrequency"); if(ddlTaskFrequency != null) ddlTaskFrequency.Attributes.Add("OnSelectedIndexChanged","javascript:SetNextMonitorDueDate(this);"); This is a test function on the clientside function SetNextMonitorDueDate(ddl) { alert(&quo...

Dropdownlist not getting the selected value ...Help
Hi, I am creating a simple data entry form with web matrix, which will insert records to my access database. I am having more than 5 dropdownlists with data coming from tables in the databae.They are databound. I have a dropdownlist called Workarea1.I would like to populate the list from the database .But after selecteing the value from the dropdown, I click the save button, then the VALUE IN THE DROPDOWNLIST IS DEFAULTED TO THE FIRST RECORD. My code looks like this. I have tried the page.ispostback condition too...but does not seem to work My code looks like this Sub Pag...

Getting Selected Value from DropDownList #2
I am trying to work my way through a beginning ASP.NET book and ran into an example that that does not work and I can't find the correct way to handle the task. The example loads a DropDownList from the Category table (Northwind) with the Value set to the CategoryID and the Text set to CategoryName. That appears to work fine. When the user selects an item in the DropDownList and clicks on a Fetch button, the following code is executed: Sub Button1_Click(sender As Object, e As EventArgs) DataGrid1.DataSource = GetProducts(lstCategory.SelectedValue) End Sub The compi...

Getting a dropdownlist selected (text) value
Alright, I give up! I've been researching this all day with no luck, although I know there's a solution. I am trying to get the Text value of an item that I selected from a dropdownlist. For example, if I've got a list that would display: SELECT YOUR FAVOURITE COLOR: DROP DOWN LIST NAME = favColor COLOR_ID | COLOR ----------------------- 1 | RED 2 | BLUE 3 | GREEN I'm obviously able to pull the integer (COLOR_ID) out of the list by using the Request.Form("favColor"), but how can I get the COLOR value/text/name?...

Web resources about - how to get SELECTED VALUE of parent dropdownlist to target dropdownlist using cascading -

Tag Synonyms - Stack Overflow
Q&A for professional and enthusiast programmers

Accidental entities - what about the UI?
This post is a follow-up to my previous blog post " Accidental entities - you don't need that identity ". In that post, we followed a consultant ...

Flash Builder Plug-in for SAP Netweaver Gateway - Adobe Labs
Search Navigation Labs Home Wiki Home Technologies Alchemy Blueprint Camera Profiles and DNG Profile Editor Cirrus ColdFusion 10 DNG Codec Fireworks ...

Air Astana - Join Now
Thank you for considering membership of Nomad Club – Kazakhstan’s first Frequent Flyer Program. You could soon be on your way to earning free ...

Languages -> C# Articles, Tutorials, Examples: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Blog - Avisra
Avisra Web Development Home Blog Services Contact The Blog Latest Module Builder: How can we make it better? Sitefinity by Chris on July 2, 2013 ...

Online Booking Tool Support
This Online Booking Tool Support page might help you as you navigate through the process of booking travel through your OBT provided by CWT. ...

@Html and beyond
... ); } return string .Format( “{0}{1}” , me.Member.Name, id); } The Html building methods are quite simple. Building a dropdownlist for a ...

Top Ranked Articles
Top Ranked Articles - Free source code and tutorials for Software developers and Architects.; Updated: 23 Feb 2013

Unit Testing DateTime.Now Without Isolation
public virtual void SeedWithYearsSince(DropDownList list, int year){ for (int index = year; index

Resources last updated: 1/2/2016 9:43:48 AM