MVC2应用程序修改回发参数

发布于 2024-12-12 17:31:14 字数 261 浏览 4 评论 0原文

我正在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

亽野灬性zι浪 2024-12-19 17:31:14

问号标记查询字符串的开头,但不是路径的一部分。

您需要对其进行 URL 编码。

The question mark marks the beginning of the querystring and is not part of the path.

You need to URL-encode it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文