当我点击以下链接:显示查询字符串asp.net
<a href="default.aspx/video/?title=I am trying get the string"> hi</a>
它作为显示:
http://example.com/default.aspx/title/?title=I%20am%20trying%20get%20the%20string
但我希望它显示像链接:
http://example.com/default.aspx/title/?title=I_am_trying_get_the_string
使用' %20'是空间的URL编码版本。如果你想用下划线替换它,那么你需要在你的代码中处理它。 – Romoku
@Romoku你好,请你指导我如何做到这一点。 – rahlrokks
'Request.QueryString [“title”]。替换(“_”,“”)' – Romoku