Request.QueryString给我空格而不是+号 [英] Request.QueryString giving me space instead of + sign
本文介绍了Request.QueryString给我空格而不是+号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我具有URL值 http://Localhost/default.aspx?ts =/+m2dAZZA3DaavaaupUXkZL83n7TwmCVm
Request.QueryString [ts]给我
Request.QueryString[ts] is giving me
/m2dAZZA3DaavaaupUXkZLL83n7TwmCVm
/ m2dAZZA3DaavaaupUXkZL83n7TwmCVm
如何确保我从查询字符串中获取所有值
How to ensure that I get all the value from the Querystring
有编码或其他东西吗?
推荐答案
生成URL的任何代码都需要对其进行正确的转义.在服务器端使用 HttpUtility.UrlEncode()
或在客户端使用 ecodeURIComponent()
客户端
whatever code that generates your URL needs to escape it properly. Use HttpUtility.UrlEncode()
server-side or ecodeURIComponent()
client-side
这篇关于Request.QueryString给我空格而不是+号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文