我怎样才能通过“&”转换为查询字符串值
我的应用程序中有一个带有以下 URL 的链接:
http://www.mysite.com/test?group=MyGroup
问题是其中一个组称为 A 组和 A 组。 B
当我尝试这个并在服务器端解析它(通过 Request.QueryString["Group"])时,
http://www.mysite.com/test?group=Group A & B
我得到
group='Group A ' (因为 &)
我如何更改我的 URL,以便它可以用“&”处理值在他们里面。
i have a link in my app with the following URL:
http://www.mysite.com/test?group=MyGroup
the issue is one of the groups is called Group A & B
when i try this and parse it on the serverside (through Request.QueryString["Group"])
http://www.mysite.com/test?group=Group A & B
i get
group='Group A ' (because of the &)
how can i change my URL so it can deal with values with "&" inside of them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 URLEncode 方法使文本对于查询字符串来说是安全的。
Use the URLEncode method to make your text safe for a querystring.