url - 查询带有特殊字符的字符串

标签 url asp-classic query-string encode

如何传递带有特殊字符的查询字符串?

例如,我需要在我的查询字符串中传递“&”,如下所示:

../solrresults.asp?mode=search&data=M & S

最佳答案

使用 Server.UrlEncode :

URLEncode converts characters as follows: Spaces ( ) are converted to plus signs (+). Non-alphanumeric characters are escaped to their hexadecimal representation.



以这种方式使用它;
<a href="page2.asp?name=<%= Server.URLEncode(sName) %>">here</a>

关于url - 查询带有特殊字符的字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9579151/

相关文章:

facebook - 获取 fb.me 网址

javascript - 未捕获的类型错误 : Cannot set property 'width' of undefined, javascript

asp-classic - ASP Classic - 数据类型不匹配错误

php - 在 MYSQL 搜索中使用 URL 参数

javascript - 如何获取google搜索结果的间接链接

node.js - NodeJS 中带有查询字符串的 HTTPS 请求

node.js - 在查询字符串 node.js 中传递对象数组

api - REST API框架。无效的querystring参数的建议行为

iphone - 在 Facebook 上发布链接不显示链接缩略图?

javascript - 如何将 html 属性值添加到 javascript 变量中