如何限制URL编辑 [英] How to restrict URL editing

查看:113
本文介绍了如何限制URL编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以限制MVC应用程序中的URL编辑?



通过超链接获取页面的模式类似于controller / ActionResult。即使用户可以输入URL并进入页面。所以如何限制用户使用直接URL访问页面。

解决方案

这就是控制器之类的漂亮URL / action /用于,这样用户只需修改URL就可以轻松浏览网站。

所以答案是 - 你无法控制这个



还有另一种解决方法 here [ ^ ]。 (但我不这样做)



-KR


如果你想阻止人们访问某些网址,那么实施一些网址像Identity或类似的身份验证。你不能阻止人们修改网址。



http: //forums.asp.net/post/5825782.aspx [ ^ ]

Is that possible to restrict URL editing in the MVC application?

The pattern to take a page is like "controller/ActionResult" by hyper link. Even if the user can enter the URL and get into the page.So how to restrict user to access page using direct URL.

解决方案

That's what pretty URLs such as controller/action/ are used for, so that the user can easily navigate the site by simply modifying the URL.
So the answer is - you can't control this.

There's a another workaround here[^]. (but I'd not do that)

-KR


If you want to stop people accessing certain urls then implement some kind of authentication like Identity or similar. You can't stop people amending the url.

http://forums.asp.net/post/5825782.aspx[^]


这篇关于如何限制URL编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆