Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all ,

I am trying to pass multiple values in query string from drop down list bt it is not working.This is my code:

Response.Redirect("~/OutdoorMedia.aspx?LoactionId="+DropDownListLocation.SelectedValue"&TypeId="+DropDownListType.SelectedValue+")


Thanks in advance.
Posted
Updated 29-Jun-11 0:21am
v2

Hi,
U may try like this....
Response.Redirect("~/OutdoorMedia.aspx?LoactionId="+DropDownListLocation.SelectedValue+"&TypeId="+DropDownListType.SelectedValue)
 
Share this answer
 
v2
Could you post the correct code instead please, as this code will not compile? I would rewrite this to look like this instead:
C#
string uri = string.Format("~/OutdoorMedia.aspx?LocationId={0}&TypeId={1}" , 
  HttpUtility.UrlEncode(DropDownListLocation.SelectedValue), 
  HttpUtility.UrlEncode(DropDownListType.SelectedValue));
Response.Redirect(uri);
You can then set a breakpoint on your Response.Redirect and see what the value in uri is.
 
Share this answer
 

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