首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

怎么取道DropDownList中的值进行查询

2011-12-13 
如何取道DropDownList中的值进行查询。各位高手如何取道DropDownList中的值进行查询。asp:DropDownListID

如何取道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>

热点排行