ASP.NET MVC 中返回视图的 URL

发布于 2024-07-13 12:01:49 字数 124 浏览 9 评论 0原文

在这个问题的上下文中链接文本可以从响应表单的控制器中获得发帖前往友好网址?

In the context of this question link text is possible from a Controller that responds to a Form Post to go to the Friendly Url?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

深者入戏 2024-07-20 12:01:49

是的。 您的控制器操作可以根据您希望为其定义的路由的方式确定友好的 url,然后重定向到友好的 url,而不是返回视图。 它将导致另一个浏览器请求,从而增加服务器的负载,因此您需要确保它确实很重要。

Yes. Your controller action can determine the friendly url based on how you would like the route defined for it, then do a Redirect to the friendly url instead of returning the view. It will cause another browser request which will add load to to your server, so you'd want to be sure that it was really important.

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