使用 AjaxPro 来完成二级联动的效果

http://www.sina.com.cn 2008年07月08日 17:28  《程序员》
  作者:chenguang79

  现在在实现二级连动或是三级连动方面,都是采用ajax来完成的。网上的例子也很多。 我采用的是AjaxPro来完的。 如何配置AjaxPro我就不说了。

BigClassid 前台页面

<script type="text/javascript">
function ShowCity(id)
{
var result = chen.getCityList(id).value;
var ddlcity = document.getElementById("ddlCity");
ddlcity.length=0;
for(var i=0; i<result.Rows.length; i++)
{
ddlcity.options.add(new Option(result.Rows[i].SmallClass,result.Rows[i].id));
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<p>
省份:<asp:DropDownList ID="ddlPro" runat="server">
</asp:DropDownList>
市区:<asp:DropDownList ID="ddlCity" runat="server">
</asp:DropDownList>
</p>
<div>

</div>
</form>
</body>
<script type="text/javascript">
function ShowCity(id)
{
var result = chen.getCityList(id).value;
var ddlcity = document.getElementById("ddlCity");
ddlcity.length=0;
for(var i=0; i<result.Rows.length; i++)
{
ddlcity.options.add(new Option(result.Rows[i].SmallClass,result.Rows[i].id));
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<p>
省份:<asp:DropDownList ID="ddlPro" runat="server">
</asp:DropDownList>
市区:<asp:DropDownList ID="ddlCity" runat="server">
</asp:DropDownList>
</p>
<div>

</div>
</form>
</body>
上一页 1 2 下一页
本文导航:
·使用 AjaxPro 来完成二级联动的效果
·使用 AjaxPro 来完成二级联动的效果(2)

发表评论 _COUNT_条
Powered By Google
不支持Flash
·城市对话改革30年 ·新浪城市同心联动 ·诚招合作伙伴 ·企业邮箱畅通无阻