.net的DropDownList控件问题

来源:百度知道 编辑:UC知道 时间:2024/07/04 07:39:21
我想在页面使用DropDownList控件并绑定新闻数据库ID,绑定后选择DropDownList内容可直接转到新闻内容页
这段代码怎么写?请告诉我下谢谢!
我才开始学,所以不知道怎么弄呵呵,别叫我看书嘛,我想知道怎么写的.请贴个代码给我吧-_-!!

在DropDownList中添加事件OnSelectedIndexChanged="ddlUniversity_SelectedIndexChanged"
然后编写代码:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Reponse.Redirect("ShowContent.aspx?id="+ DropDownList1.SelectedValue.ToString());
}