dimanche 10 mai 2015

ASP.NET MVC: Unauthenticated User Always Redirected to Login page

I've been trying to fix this for a week now, I tried everything that crossed my mind. I am creating web app using asp.net mvc 4 template. Problem is that I am always redirected to login page before I can't access any route without log in first. Not even register new user, which is absurd. I'm using simple membership and default Account controller and I even tried removing [Authorize] attribute from Account controller, but even then I'm redirected to login page. My Account controller looks like this:

[Authorize]
[InitializeSimpleMembership]
public class AccountController : Controller
{
...
    [AllowAnonymous]
    public ActionResult Register()
    {
        return View();
    }

My web config is:

    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" />
   </authentication>

In chrome when I click on Register link, I get this error enter image description here

Aucun commentaire:

Enregistrer un commentaire