html**
<
form
id="form1"
runat="server"
>
<
div>
<
divid="dv"
>
<
table
>
<
tr>
<
td>
<
asp:dropdownlist
id="ddlprovince"
runat="server"
onchange="provincechange()"
>
asp:dropdownlist
>
td>
<
td>
<
select
id="ddlcity"
runat="server"
onchange="citychange()"
>
select
>
td>
<
td>
<
select
id="ddlarea"
runat="server"
>
select
>
td>
tr>
table
>
<
br/>
<
asp:button
id="button1"
runat="server"
onclick="button1_click1"
text="檢視省市縣"
/>
div>
<
script
>
function provincechange()
}else
}function citychange()
}else
}script
>
div>
form
>
cs**
public sqldmo sqldmo = new sqldmo();
protected
void page_load(object sender, eventargs e)
ajaxpro.utility.registertypeforajax(typeof(_default));
}private
void setprovince()
[ajaxpro.ajaxmethod]
public
string getparent(string parentid)
return strcity;
}
js省市縣聯動
select 或text的onchange事件需要手動 通過鍵盤輸入 改變select或text的值才能觸發,如果在js中給select或text賦值,則無法觸發onchang事件,例如,在頁面載入完成以後,需要觸發乙個onchange事件,在js中用document.getelementbyid ...
省市聯動 ajax
省 浙江江蘇 城市 縣城 告訴瀏覽器使用utf8編碼 儲存時必須為無bom header content type text xml charset utf 8 告訴瀏覽器不使用快取 header cache control no cache 接收使用者的選擇的省份的名字 province post...
省市縣聯動列表資料整理
function if val.leveltype 2 if val.leveltype 3 for let i province.length 1 i 0 i children list.p province i let cityarr 市資料 for let c city.length 1 c ...