[求助]省市联动存储时该如何提取数据?
我想通过存储过程来进行会员注册,可是在省市联动环节上,老是读不到数据,请各位大虾帮忙看看!!谢谢!!
aspx文件中的代码:
<SCRIPT LANGUAGE="JavaScript">
<!--
function Dsy()
{
this.Items ={};
}
Dsy.prototype.add = function(id,iArray)
{
this.Items[id] =iArray;
}
Dsy.prototype.Exists = function(id)
{
if(typeof(this.Items[id]) == "undefined") return false;
return true;
}
function change(v)
{
var str="0";
for(i=0;i<v;i++)
{
str+=("_"+(document.getElementById(s[i]).selectedIndex-1));
};
var ss=document.getElementById(s[v]);
with(ss)
{
length = 0; options[0]=new Option(opt0[v],opt0[v]);
if(v && document.getElementById(s[v-1]).selectedIndex>0 || !v)
{
if(dsy.Exists(str))
{
ar = dsy.Items[str];
for(i=0;i<ar.length;i++)options[length]=new Option(ar[i],ar[i]);
if(v)options[1].selected = true;
}
}
if(++v<s.length)
{
change(v);
}
}
}
var dsy = new Dsy();
dsy.add("0",["安徽","北京","福建","甘肃","广东","广西","贵州","海南","河北","河南","黑龙江","湖北","湖南","吉林","江苏","江西","辽宁","内蒙古","宁夏","青海","山东","山西","陕西","上海","四川","天津","西藏","新疆","云南","浙江","重庆"]);
dsy.add("0_0",["安庆","蚌埠","巢湖","池州","滁州","阜阳","合肥","淮北","淮南","黄山","六安","马鞍山","宿州","铜陵","芜湖","宣城","亳州"]);
dsy.add("0_0_1",["蚌埠市","固镇县","怀远县","五河县"]);
dsy.add("0_0_2",["巢湖市","含山县","和县","庐江县","无为县"]);
(由于字数限制,省略了省市.....)
dsy.add("0_29",["杭州","湖州","嘉兴","金华","丽水","宁波","绍兴","台州","温州","舟山","衢州"]);
dsy.add("0_29_0",["淳安县","富阳市","杭州市","建德市","临安市","桐庐县"]);
dsy.add("0_29_1",["安吉县","长兴县","德清县","湖州市"]);
dsy.add("0_29_2",["海宁市","海盐县","嘉善县","嘉兴市","平湖市","桐乡市"]);
dsy.add("0_29_3",["东阳市","金华市","兰溪市","磐安县","浦江县","武义县","义乌市","永康市"]);
dsy.add("0_29_4",["景宁畲族自治县","丽水市","龙泉市","青田县","庆元县","松阳县","遂昌县","云和县","缙云县"]);
dsy.add("0_29_5",["慈溪市","奉化市","宁波市","宁海县","象山县","余姚市"]);
dsy.add("0_29_6",["上虞市","绍兴市","绍兴县","新昌县","诸暨市","嵊州市"]);
dsy.add("0_29_7",["临海市","三门县","台州市","天台县","温岭市","仙居县","玉环县"]);
dsy.add("0_29_8",["苍南县","洞头县","乐清市","平阳县","瑞安市","泰顺县","温州市","文成县","永嘉县"]);
dsy.add("0_29_9",["舟山市","岱山县","嵊泗县"]);
dsy.add("0_29_10",["常山县","江山市","开化县","龙游县","衢州市"]);
dsy.add("0_30",["重庆"]);
dsy.add("0_30_0",["城口县","大足县","垫江县","丰都县","奉节县","合川市","江津市","开县","梁平县","南川市","彭水苗族土家族自治县","荣昌县","石柱土家族自治县","铜梁县","巫山县","巫溪县","武隆县","秀山土家族苗族自治县","永川市","酉阳土家族苗族自治县","云阳县","忠县","重庆市","潼南县","璧山县","綦江县"]); //-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
var s=["s1","s2","s3"];
var opt0 = ["省份","城市","市、县级市、县"];
function setup()
{
for(i=0;i<s.length-1;i++) document.getElementById(s[i]).onchange=new Function("change("+(i+1)+")");
change(0);
}
//-->
</SCRIPT>
<body onload="setup();">
<form id=frm>
<asp:DropDownList ID="s1" Runat="server">
<asp:ListItem>省份</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="s2" Runat="server">
<asp:ListItem>城市</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="s3" Runat="server">
<asp:ListItem>市、县级市、县</asp:ListItem>
</asp:DropDownList>
</form>
</body>
cs文件中。。。。
SqlParameter par7=new SqlParameter("@zy_sheng",SqlDbType.VarChar,20);
com2.Parameters.Add(par7);
par7.Direction=ParameterDirection.Input;
par7.Value=s1.SelectedItem.Value.ToString();
SqlParameter par8=new SqlParameter("@zy_city",SqlDbType.VarChar,20);
com2.Parameters.Add(par8);
par8.Direction=ParameterDirection.Input;
par8.Value=s2.SelectedItem.Value.ToString();
请问这两句红色的该如何写?