【发布时间】:2014-10-25 10:51:04
【问题描述】:
我有一个使用 ASP.NET 4.5 和 ASP.net Identity 2.0 开发的现有 Web 应用程序。我在 RouteConfig.cs 中有这样的路由器设置:
public static void RegisterRoutes(RouteCollection routes)
{
var settings = new FriendlyUrlSettings();
settings.AutoRedirectMode = RedirectMode.Permanent;
routes.EnableFriendlyUrls(settings);
routes.MapPageRoute("manage-user-acc", "manage-user-acc", "~/Account/Manage.aspx", true);
}
manage.aspx 页面必须登录才能查看。当应用程序运行时,我在地址栏中输入 url,如下所示:
http://localhost:64296/manage-user-acc
returnUrl 不起作用,错误是
访问提供此服务所需的资源时出错 要求。您可能没有查看请求的权限 资源。
但是当我在地址栏中输入这样的网址时
http://localhost:64296/Account/Manage
returnUrl 正在工作并返回登录页面,如下所示:
http://localhost:64296/Account/Login?ReturnUrl=%2Faccount%2Fmanage
所以任何人都可以帮助我找出我在哪里做错了。或者如何调试所有进程
【问题讨论】:
标签: asp.net webforms forms-authentication