在querystring中传递多个值不起作用 [英] Passin multiple values in querystring not working

查看:49
本文介绍了在querystring中传递多个值不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试从下拉列表bt传递查询字符串中的多个值,但它不起作用.这是我的代码:

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.

推荐答案


你可以这样尝试....
Response.Redirect("~/OutdoorMedia.aspx?LoactionId="+DropDownListLocation.SelectedValue+"&TypeId="+DropDownListType.SelectedValue)
Hi,
U may try like this....
Response.Redirect("~/OutdoorMedia.aspx?LoactionId="+DropDownListLocation.SelectedValue+"&TypeId="+DropDownListType.SelectedValue)


您能否发布正确的代码,因为该代码无法编译?我会改写成这样:
Could you post the correct code instead please, as this code will not compile? I would rewrite this to look like this instead:
string uri = string.Format("~/OutdoorMedia.aspx?LocationId={0}&TypeId={1}" , 
  HttpUtility.UrlEncode(DropDownListLocation.SelectedValue), 
  HttpUtility.UrlEncode(DropDownListType.SelectedValue));
Response.Redirect(uri);

然后您可以在Response.Redirect上设置一个断点,并查看uri中的值是什么.

You can then set a breakpoint on your Response.Redirect and see what the value in uri is.


这篇关于在querystring中传递多个值不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆