⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.aspx

📁 Ajax三级联动和无刷新分页源码,数据库操作采用的是SqlHelper
💻 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>
				<!--省份列表  这里的数据刷新页面时直接去数据库得到。。-->
			
				<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>
				<!--区的列表 -->
				<select id="qu" runat="server" >
					<option value="0">
						--请选择区--
					</option>
				</select>
			</form>
		</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -