当前位置: 代码迷 >> ASP.NET >> 从数据库读取出来的数据放到DropDownList后怎么加超链
  详细解决方案

从数据库读取出来的数据放到DropDownList后怎么加超链

热度:2845   发布时间:2013-02-25 00:00:00.0
从数据库读取出来的数据放到DropDownList后如何加超链
我从数据库中读出来的数据已经放到了DropDownList中,但是我想点击DropDownList列表中的任意一条数据就可以链接到指定的地方,这个该怎么做呀,求教

------解决方案--------------------------------------------------------
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Redirect(DropDownList1.SelectedValue);
}

<asp:DropDownList ID="DropDownList1" AutoPostBack="true" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
  相关解决方案