日期:2014-05-18  浏览次数:20712 次

ajax 的全国地址三级 选择菜单 无刷新 会显示Method Error 500 请大家帮忙调试一下
ajax 的全国地址三级 选择菜单 无刷新 会显示Method Error 500 请大家帮忙调试一下 
net2.0 + sql2000
谢谢

------解决方案--------------------
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
省: <asp:DropDownList ID="ddlprovince" runat="Server"> 
<asp:ListItem Value="">省分</asp:ListItem>
</asp:DropDownList> 
市<asp:DropDownList ID="ddlcity" runat="server">
<asp:ListItem Value="">市</asp:ListItem>
</asp:DropDownList>
区或县:
<asp:DropDownList ID="ddlarea" runat="server">
<asp:ListItem Value="">县</asp:ListItem>
</asp:DropDownList>

</div>
</form>
<script type="text/javascript">
function provinceChange(obj)
{
var city=document.getElementById("ddlcity");
if(obj.value.length>0)
{
var webFileUrl="?province="+obj.value;
BindData(city,webFileUrl);
}
else
{
city.length=1;
}
}
function cityChange(obj)
{
var borough = document.getElementById("ddlarea");
if (obj.value.length > 0)
{
//传递参数
var webFileUrl = "?City=" + obj.value;
//绑定区
BindData(borough,webFileUrl);
}
else
{
borough.length = 1;
}
}
function BindData(control,Url)
{
var xmlHttp = GetXmlHttp();
xmlHttp.open("POST", url, false);
xmlHttp.send("");
//得到结果
var result = xmlHttp.responseText;
if(result != "")
{
//构造XmlDocument
var xmlDoc = new ActiveXObject("MSXML2.DOMDocument");
var flag = xmlDoc.loadXML(result);
//得到结果
var nodes = xmlDoc.selectNodes("//CodeNamePair[@code]");
//清空原有记录
control.length = 0;
//重新绑定
for(var i = 0 ; i < nodes.length;i++)
{
var node = nodes[i];
   control.options.add(new Option(node.attributes[1].value,node.attributes[0].value));
}
}
else
{
//
}
}
</script>
写了一些脚本。。其它的一些数据绑定操作自己搞定。。。
------解决方案--------------------
http://singlepine.cnblogs.com/articles/257954.html


代码都有了