MVC2应用程序修改回发参数
我正在 MVC2 应用程序内构建一个博客引擎。
每个帖子的 URL 包含 URL 的标题。当标题带有问号时,问号很自然地出现在 URL 中,但是当请求到达控制器时,问号已被删除。
据推测,这是某种安全措施,但在这种情况下它会引起问题。
谁能告诉我如何解决这个问题?
网址的格式是
http://www.mydomain.com/posts/title-with-question-mark?/
I'm building a blog engine inside an MVC2 app.
The URL for each post contains the title of the URL. When the title has a question mark, the question mark quite naturally appears in the URL, but when the request arrives at the controller, the question mark has been removed.
Presumably this is some security measure, but in this situation it's causing a problem.
Can anyone tell me how to work around this?
The format of the URL is
http://www.mydomain.com/posts/title-with-question-mark?/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问号标记查询字符串的开头,但不是路径的一部分。
您需要对其进行 URL 编码。
The question mark marks the beginning of the querystring and is not part of the path.
You need to URL-encode it.