如何基于多个下拉列表更改URL [英] How to change the url based on Multiple Drop Down Lists
问题描述
我正在使用多个下拉列表来选择一些选项.一切正常,我只需要更改URL中的名称即可.有没有一种方法可以仅基于该选项更改URL?
在第一个下拉列表中选择国家,第二个下拉列表中选择州
最后我想要这样的网址http://localhost/dynamicurl/Default.aspx?Country = india& state = Delhi
我只解决一个下拉列表
像这样的代码
< b> Response.Redirect(string.Format("Default.aspx& Country = {0}",this.DropDownList1.SelectedValue,true);</b>
提前致谢.....
Hi,
I am using a multiple Drop Down Lists for selecting some options. Everything works fine, all I need is to change the name in the URL. Is there a way to change the URL ONLY based on the option?
in first dropdownlist select country and second dropdownlist select states
finally i want the url like this http://localhost/dynamicurl/Default.aspx?Country=india&state=Delhi
i solve for only one dropdownlist
the code like this
<b>Response.Redirect(string.Format("Default.aspx&Country={0}", this.DropDownList1.SelectedValue, true);</b>
Thanks In Advance.....
推荐答案
尝试:
string myUrl = string.Format(@"http://Localhost/dynamicurl/Default.aspx?Country={0}&state={1}", dropDownCountry.Text, dropDownState.Text);
这篇关于如何基于多个下拉列表更改URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!