【发布时间】:2013-07-24 13:45:10
【问题描述】:
我正在将 url 保存在数据库中,并且相应的用户被映射到 url
URL: ~/user
从应用程序,我正在检查通过
bool isAuthorized = DBHelper.IsAuthorized(
string.Concat("~" , Url.Action("Index", "User"),
httpContext.User.Identity.Name);
它在开发环境中运行良好。但在生产中,应用程序是在 IIS 应用程序 ucms 下配置的,因此 Url.Action("Index", "User") 返回 /ucms/user 因此isAuthorized 返回 false。
任何人都可以提供任何意见或方向来解决这种行为。
【问题讨论】:
-
那些偶然发现这个问题的人也应该检查你以前的问题:stackoverflow.com/questions/17840063/…
标签: c# asp.net-mvc asp.net-mvc-4 iis-7