?? default.aspx
字號:
?<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script type="text/javascript" src="ajax_func.js"></script>
<script>
function changsheng(va)
{
if(va!='0')
{
var city = document.getElementById("city");
city.disabled=false;
var qu = document.getElementById("qu");
qu.disabled=true;
var f=document.getElementById("qu");
f.options.length=1;
var url="Handler.ashx?type=sheng&id="+va;
send_request("GET",url,null,"text",populateClass3);
}
}
function populateClass3(){
var f=document.getElementById("city");
if(http_request.readyState==4){
if(http_request.status==200){
var list=http_request.responseText;
var classList=list.split("|");
f.options.length=1;
for(var i=0;i<classList.length;i++){
var tmp=classList[i].split(",");
f.add(new Option(tmp[1],tmp[0]));
}
}else{
alert("您所請求的頁面有異常。");
}
}
}
function changshi(va)
{
if(va!='0')
{
var qu = document.getElementById("qu");
qu.disabled=false;
var url="Handler.ashx?type=shi&id="+va;
send_request("GET",url,null,"text",populateClass4);
}
}
function populateClass4(){
var f=document.getElementById("qu");
if(http_request.readyState==4){
if(http_request.status==200){
var list=http_request.responseText;
var classList=list.split("|");
f.options.length=1;
for(var i=0;i<classList.length;i++){
var tmp=classList[i].split(",");
f.add(new Option(tmp[1],tmp[0]));
}
}else{
alert("您所請求的頁面有異常。");
}
}
}
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<FONT face="宋體"></FONT>
<!--省份列表 這里的數(shù)據(jù)刷新頁面時(shí)直接去數(shù)據(jù)庫得到。。-->
<select id="sheng" style="width: 121px" runat="server" onchange="changsheng(this.value)">
<option value="0">
--請選擇省--
</option>
</select>
<!--城市列表 等到ajax查詢出該省份的所有城市,用填充到城市列表中-->
<select id="city" runat="server" onchange="changshi(this.value)">
<option value="0">
--請選擇市--
</option>
</select>
<!--區(qū)的列表 -->
<select id="qu" runat="server" >
<option value="0">
--請選擇區(qū)--
</option>
</select>
</form>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -