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

如何取道DropDownList中的值进行查询。
各位高手如何取道DropDownList中的值进行查询。

<asp:DropDownList   ID= "DDList "   runat= "server "   Width= "80 ">
<asp:ListItem   value= "全部订单 "> 全部订单 </asp:ListItem>
<asp:ListItem   value= "等待处理 "> 等待处理 </asp:ListItem>
<asp:ListItem   value= "已付款 "> 已付款 </asp:ListItem>
<asp:ListItem   value= "已发货 "> 已发货 </asp:ListItem>
<asp:ListItem   value= "已结单 "> 已结单 </asp:ListItem>
</asp:DropDownList>  

<a   href= "DDZXadm.aspx?DDZT=   "取DDList中的值 "> 查询 </a>   </td>

------解决方案--------------------
<a href= "javascript:window.location.href= 'DDZXadm.aspx?DDZT= "+document.getElementById( 'DDList ').value+ " ' " >
------解决方案--------------------
别用 <a>

用链接按钮吧

protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Write( "DDZXadm.aspx?DDZT= " + DDList.SelectedValue);
}
------解决方案--------------------
<script language= "javascript " type= "text/javascript ">
function search()
{
var ddl = document.getElementById( "DDList ");
window.location = "DDZXadm.aspx?DDZT= " + ddl.options[ddl.selectedIndex].value;
}

</script>

<body>
<form id= "form1 " runat= "server ">
<div>
<asp:DropDownList ID= "DDList " runat= "server " Width= "80 ">
<asp:ListItem Value= "全部订单 "> 全部订单 </asp:ListItem>
<asp:ListItem Value= "等待处理 "> 等待处理 </asp:ListItem>
<asp:ListItem Value= "已付款 "> 已付款 </asp:ListItem>
<asp:ListItem Value= "已发货 "> 已发货 </asp:ListItem>
<asp:ListItem Value= "已结单 "> 已结单 </asp:ListItem>
</asp:DropDownList>
<input type= "button " value= "查询 " onclick= "search() " />
</div>
</form>
</body>