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 AutoPostBack=true OnSelectedIndexChanged=DropDownList_SelectedIndexChanged/
•••
!--(yng)CascadingDropDownؼ--
ajaxToolkit:CascadingDropDown ID=CascadingDropDown1 runat=server TargetControlID=DropDownList1 LoadingText=ڼd^(q)͡ PromptText=Ոx^(q)͡ ServicePath=UserManage.asmx ServiceMethod=getAreaType Category=typename
/ajaxToolkit:CascadingDropDown
ajaxToolkit:CascadingDropDown ID=CascadingDropDown2 runat=server TargetControlID=DropDownList2 ParentControlID=DropDownList1 LoadingText=ڼdмС PromptText=ՈxмС ServicePath=UserManage.asmx ServiceMethod=getCity Category=cityname
/ajaxToolkit:CascadingDropDown
ajaxToolkit:CascadingDropDown ID=CascadingDropDown3 runat=server TargetControlID=DropDownList3 ParentControlID=DropDownList2 LoadingText=ڼdhСPromptText=ՈxhС ServicePath=UserManage.asmx ServiceMethod=getCountry Category=countryname
/ajaxToolkit:CascadingDropDown
WebServicea(бWebServicea):
//@ȡh
[WebMethod]
public CascadingDropDownNameValue[] getCountry(string knownCategoryValues, string category)
{StringDictionary kv= CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
•••
if ((kv.ContainsKey(rolename) && kv.ContainsKey(cityname) && kv[rolename] == 6fc98827-de43-4026-b67d-b4d207fb1afd)|| (kv.ContainsKey(typename) && kv.ContainsKey(cityname)))
{ DataTable countries = getCountryTable(kv[cityname].ToString());
//б
ListCascadingDropDownNameValue values = new ListCascadingDropDownNameValue();
foreach (DataRow dr in countries.Rows)
{ values.Add(new CascadingDropDownNameValue(dr[CountryName].ToString(), dr[CountryID].ToString())); }
return values.ToArray();
•••
4 Y(ji)Z
ASP.NET AJAXʵֻһ(g)JavaScriptһ(g){(dio).NETM,һ(g)ӵƽ_,܉(chung)푑(yng)ԸӑB(ti)DDO(sh)һ(g)ȫͬ͵Web(yng)óσ(ni)ݿ֪,(g)ͬӴʹASP.NET AJAXܡ,ASP.NET AJAX߀ڲİl(f)չ,ԴđA(y)y,ASP.NET AJAX Control Toolkitṩķ(w)˔U(ku)չؼ,_l(f)ߘO鷽؞F(xin)еASP.NET(yng)óAjax;(w)ƽ_όЌASP.NET AJAX(w)˿ؼ/MČ(sh)F(xin)?
īI(xin)?
[1].ASP.NET AJAXO(sh)Ӌ(j)(I): (w)ASP.NET 2.0 AJAX ExtensionscASP.NET AJAX Control Toolkit [M]. : ]늳, 2007.?
[2].ASP.NET 2.0 AjaxO(sh)Ӌ(j)(II): ͑Microsoft AJAX LibrarycͨŌ[M]. : ]늳, 2007.?
[3][] Matthew MacDonald, Mario Szpuszta.ASP.NET 3.5O(sh)Ӌ(j)(2) [M]. : ]늳, 2008.?
P(gun)~ ASP NET ӣУΣţԡʣطc(yng) asp net+ajax asp net ajax
c(din)x