Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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.....
Posted
Updated 13-Feb-12 20:48pm
v4
Comments
CRDave1988 14-Feb-12 2:34am    
Make Ur Question More Clear.
Sergey Alexandrovich Kryukov 14-Feb-12 2:39am    
What is "change the name in the URL". What are your trying to do, generally?
--SA
Varun Sareen 14-Feb-12 2:50am    
what do you want to achieve? Please be more clear in your question so that we help you around with different number of solutions.

Thanks

1 solution

Try:
C#
string myUrl = string.Format(@"http://Localhost/dynamicurl/Default.aspx?Country={0}&state={1}", dropDownCountry.Text, dropDownState.Text);
 
Share this answer
 
Comments
Tech Code Freak 14-Feb-12 4:27am    
5up!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900