我在我的MVC 3应用程序中使用了表单身份验证,并且遇到了我的返回URL问题。ASP.NET MVC 3 FormsAuthentication ReturnURL
当我标志着家庭控制器上的动作<Authorize>
,它重定向到登录页面和作品,但返回URL然后/
,所以当它重定向,它被重定向到当前URL Authorize
的根源。
所以URL的是这样的:
http://localhost/ - 控制器=首页 - 行动=指数
http://localhost/Authentication/LogOn
我结束了这一点:http://localhost/Authentication/LogOn?ReturnURL=~%2F,我需要找回http://localhost/
帮助!! :)
什么是你的http://本地主机/默认路由? – 2011-03-29 17:09:46
@Nazar - 'routes.MapRoute(_ “Default”,_ “{controller}/{action}/{id}”,_ New with {.controller =“Home”,.action =“Index”, .id = UrlParameter.Optional} _ )' – Sam 2011-03-29 17:23:51