【发布时间】:2020-06-30 05:49:56
【问题描述】:
只是想知道是否可以在 MVC 中编辑 URL?
比如我在user id = 1下登录profile,所以生成的URL会是
https://something/Home/Profile?id=1
所以当用户编辑链接到
https://something/Home/Profile?id=2
他们将能够访问另一个用户个人资料
有没有可能实现
https://something/Home/Profile
这样用户将无法编辑链接
另一种情况是,当用户在 URL 中输入其他 id 时,该页面仍将保留在他们自己的个人资料页面上。
提前致谢!
【问题讨论】:
标签: asp.net-mvc model-view-controller controller routes