Hi
I have 3 Dropdownlist
1-DDlcity 2-DDlRegion 3-DDlDistrict
and below is House_info table
district
|
region
|
city
|
Id
|
can
|
1
|
Canada
|
1
|
Lon
|
1
|
London
|
2
|
Ita
|
2
|
Canada
|
3
|
now when I select city from DDlcity after that select region from DDlregion according to my selected item from DDlcity and DDlregion it bind DDlDistrict...
before I used OnselectedIndexChange below is SP...
ALTER procedure [dbo].[SelectِDistrict]
@Region NVARCHAR(30),
@city NVARCHAR(40)
AS
BEGIN
SELECT ID,Centername
FROM District
WHERE (Region=@Region or @Region='0') and (city=@city or @city='0')
ORDER BY Centername ASC
END
it worked correctly
but now I use cascadingdropdown list
[WebMethod]
public CascadingDropDownNameValue[] GetDistrict(string knownCategoryValues)
{
string region = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)["Region"];
string query = string.Format("SELECT District FROM District WHERE Region = N'{0}'", region);
List<CascadingDropDownNameValue> district = GetData(query);
return district.ToArray();
}
problem is that when I select city=canada then region=1 I want it bind in DDldistrict =can but here it show in DDLdistrict can and Lon
here it just select district that region=1 it doesn't attention to city selected Item I want it do like SP that I used...
Best Regrads
Neda