在querystring中传递多个值不起作用

编程入门 行业动态 更新时间:2024-10-21 17:35:04
本文介绍了在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中传递多个值不起作用

本文发布于:2023-11-27 04:16:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636556.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   不起作用   querystring

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!