在mvc4 razor中设置Return Url [英] Setting Return Url in mvc4 razor

查看:223
本文介绍了在mvc4 razor中设置Return Url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我为我的mvc4网络应用程序创建了一个自定义登录页面。但是当未经授权的用户试图访问控制器时,请说Home / Index页面被重定向到 / Account / Login?ReturnUrl =%2fhome%2findex 。如何将其重定向到我的用户/登录



在哪里设置,我删除了我的帐户控制器,帐户视图和帐户模型,仍然页面重定向到 /帐户/登录?ReturnUrl =%2femployee%2findex



请帮助修复此

Hi,
I have created a custom loging page for my mvc4 web application. But when an unauthorized user tried to access a controller, say Home/Index the pageis redirected to "/Account/Login?ReturnUrl=%2fhome%2findex". How can i redirect it to my User/Login.

Where is it set,I have removed my Account Controller,Account Views and Account Model,Still the page is redirecting to "/Account/Login?ReturnUrl=%2femployee%2findex".

please helpmeto fix this

推荐答案

该设置位于 web.config 文件中。



That setting sits in your web.config file.

<authentication mode="Forms">
  <forms loginUrl="~/PageToLogin/Login" timeout="2880" slidingExpiration="true" name=".ASPXAUTH_MyAuthenticationCookie" />
</authentication>


这篇关于在mvc4 razor中设置Return Url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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