am using ajax cascading dropdownlist when the page gets load i want the dropdownlist should be selected to the country which i had store in database instead of select country option what i should do for it this is my code public CascadingDropDownNameValue[] GetCountry(string knownCategoryValues, string category) { MNBusinessLogic.Admin adm = new MNBusinessLogic.Admin(); DataSet dsUpdate = adm.GetMasters(0, "Country", 0, true, false); List<CascadingDropDownNameValue> countrydetails = new List<CascadingDropDownNameValue>(); if (dsUpdate != null && dsUpdate.Tables.Count > 0 && dsUpdate.Tables[0].Rows.Count > 0) { foreach (DataRow dtrow in dsUpdate.Tables[0].Rows) { string CountryID = dtrow["uid"].ToString(); string CountryName = dtrow["MasterKey"].ToString(); countrydetails.Add(new CascadingDropDownNameValue(CountryName, CountryID)); } } return countrydetails.ToArray(); } and aspx code is <asp:DropDownList ID="ddlC" runat="server"> </asp:DropDownList> <ajaxToolkit:CascadingDropDown ID="cascadingddlC" runat="server" TargetControlID="ddlC" PromptText="Select Country" LoadingText="Loading" Category="Country" ServiceMethod="GetCountry" ServicePath="cascadingHelper.asmx"> </ajaxToolkit:CascadingDropDown>
cascadingddlC.SelectedValue = ds1.Tables[0].Rows[0]["Country"].ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)