【问题标题】:How to handle ampersand in URL string with more parameters as a value如何使用更多参数作为值处理 URL 字符串中的 & 符号
【发布时间】:2017-06-14 13:11:15
【问题描述】:

我正在尝试将 & 号作为 url 参数之一的值发送,但没有任何成功。

Response.Redirect(String.Format("WebForm.aspx?P1=&P2=&P3="));

例如"WebForm.aspx?P1=John&P2=Smith&P3=Del&Company" 返回 John Smith Del。因此,作为 url 中的值的 & 之后的所有内容都会被修剪。

有什么技巧可以解决这个问题。

注意:url 是由其他地方的参数提供的。

【问题讨论】:

标签: asp.net asp.net-mvc uri


【解决方案1】:

您是否尝试将& 替换为&

How can I add an ampersand for a value in a ASP.net/C# app config file value

【讨论】:

  • Url 正在从其他地方动态获取参数。我该如何处理。
  • @martinkabe 您应该编辑您的问题并添加该详细信息。
猜你喜欢
  • 2013-10-31
  • 2020-11-28
  • 2010-12-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-10-01
  • 1970-01-01
  • 2015-03-21
相关资源
最近更新 更多