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ȫؿм(j)(lin)ĘI(y)(w)߉ͨ^_l(f)ˆTԺܷ؏ Xml ߔ(sh)(j)(k)Ы@P(gun)(sh)(j)P(gun)Ҫa:
!--бؼ--
asp:DropDownList ID=DropDownList1 runat=server SkinID=ddl1 AutoPostBack=true OnSelectedIndexChanged=DropDownList_SelectedIndexChanged/
•••
!--(du)(yng)CascadingDropDownؼ--
ajaxToolkit:CascadingDropDown ID=CascadingDropDown1 runat=server TargetControlID=DropDownList1 LoadingText=ڼd^(q)͡ PromptText=Ո(qng)x^(q)͡ ServicePath=UserManage.asmx ServiceMethod=getAreaType Category=typename
/ajaxToolkit:CascadingDropDown
ajaxToolkit:CascadingDropDown ID=CascadingDropDown2 runat=server TargetControlID=DropDownList2 ParentControlID=DropDownList1 LoadingText=ڼdм(j)С PromptText=Ո(qng)xм(j)С ServicePath=UserManage.asmx ServiceMethod=getCity Category=cityname
/ajaxToolkit:CascadingDropDown
ajaxToolkit:CascadingDropDown ID=CascadingDropDown3 runat=server TargetControlID=DropDownList3 ParentControlID=DropDownList2 LoadingText=ڼdh(j)СPromptText=Ո(qng)xh(j)С ServicePath=UserManage.asmx ServiceMethod=getCountry Category=countryname
/ajaxToolkit:CascadingDropDown
WebServicea((j)бWebServicea):
//@ȡh(j)
[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(k)һ(g)(jin){(dio).NETM,һ(g)ӵƽ_(ti),܉(chung)푑(yng)Ը(dng)B(ti)DDO(sh)һ(g)ȫͬ͵Web(yng)óσ(ni)ݿ֪,(g)ͬӴʹASP.NET AJAX,ASP.NET AJAX߀ڲİl(f)չ,ԴđA(y)y(c),ASP.NET AJAX Control Toolkitṩķ(w)˔U(ku)չؼ,_l(f)ߘO鷽؞F(xin)еASP.NET(yng)óAjax;(w)ƽ_(ti)όЌ(du)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.5(j)O(sh)Ӌ(j)(2) [M]. : ]늳, 2008.?
P(gun)~ ASP NET ӣУΣţԡʣطc(yng) asp net+ajax asp net ajax
c(din)x