1、頁面上添加
代碼如下:
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
2、在head之間
代碼如下:
<script type="text/javascript">
function openwindow(url) {
if (url != "") {
window.open(url);
}
}
</script>
3、cs代碼
代碼如下:
protected void Page_Load(object sender, EventArgs e)
{
DropDownList1.Attributes.Add("onchange", "javascript:openwindow(this.value)");
}