.NET App redirects to login page

时间:2017-08-05 12:31:41

标签: c# asp.net visual-studio

Im building an application in Visual Studio. When I run the debug mode, It automatically redirects me to the login page. The start page URL is this: http://localhost:52450/Home but That won't load and redirects to http://localhost:52450/Admin/Login?ReturnUrl=%2fHome. The application should be usable even without the login though.

I found this in my web.config file:

<authentication mode="Forms">

  <forms loginUrl="/Admin/Login" />

</authentication>

1 个答案:

答案 0 :(得分:0)

以下修复程序之一将对您有所帮助。

  1. 您应该启用Anonymous身份验证方法以及Forms身份验证。
  2. 您已将Authorize属性添加到控制器,暂时将其删除,但稍后在实施登录页面时添加。
相关问题