从下拉列表项导航到另一个页面? [英] Navigate from drop downlist item to another page?
本文介绍了从下拉列表项导航到另一个页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
从下拉列表项导航到另一页
i创建了1个网页页面包含下拉列表:工作,公寓
我希望一旦点击下拉列表框选择工作后该页面导航到工作页面
怎么写逻辑和网站请回复我
Dear All,
navigate from dropdownlist item to another page
i created 1 web page that page contain dropdownlist : jobs, flats
and i want once click dropdownlist box select jobs after that page navigate to jobs page
how write the logic and sites please reply me
推荐答案
protected void Page_Load(object sender, EventArgs e)
{
DropDownList1.Items.Add("Home");
DropDownList1.Items.Add("Login");
DropDownList1.Items.Add("Signup");
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
string sUrl = DropDownList1.SelectedItem.Text + ".aspx";
Response.Redirect(sUrl);
}
并在.aspx中设置 AutoPostBack =true
-KR
and set AutoPostBack="true"
in .aspx
-KR
这篇关于从下拉列表项导航到另一个页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文