Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6379749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:10:40+00:00 2026-05-25T02:10:40+00:00

I have a strange error I have never run into before. I secured a

  • 0

I have a strange error I have never run into before.

I secured a controller with:

[Authorize(Roles = "admin")] 
public class LoggingController : Controller

When a non-admin user tries to access any protected content, they are redirected to:

http://localhost:50501/Account/Login?ReturnUrl=%2flogging

note: account/login and NOT account/logon

The AccountController.Login action does not exist.

web.config has:

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

I can of course implement the Login action and redirect to Logon.
I am just puzzled and would like to know why this happens.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:10:41+00:00Added an answer on May 25, 2026 at 2:10 am

    Search your project for login – it has to be specified somewhere. Is there any other web.config value overriding this (maybe looking at a child root and the parent value is being used)
    Also is there any redirect that is happening? Are there any defaults set in your machine’s web.config?
    Is your default url on the project set to be a /login?

    Install glimpse route debugger to see which route is being used for this page as well.

    EDIT:
    A little more research yields a known issue.
    Check out this link:
    ASP.NET MVC issue with configuration of forms authentication section

    Theres a bug in mvc 3 beta – are you running the beta bits?
    Also notice the mentioned item in the above url for RTM bits:

    <add key="loginUrl" value="~/LogOn" />
    

    Also check out
    http://forums.asp.net/p/1616153/4138366.aspx

    EDIT 2

    Below is a solid comment about a potential source of this from @santiagoIT (upvote his comment please if the specifics help you)

    Today I discovered the root of this problem: I had added ‘deployable dependency’ on ‘ASP.NET Web Pages with Razor Syntax’. This adds a reference to: WebMatrix.Data.dll This assembly has a class with a static constructor that does the following: static FormsAuthenticationSettings(){ FormsAuthenticationSettings.LoginUrlKey = “loginUrl”; FormsAuthenticationSettings.DefaultLoginUrl = “~/Account/Login”;} That explains!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange error where my jquery ajax request doesn't submit all the
I am getting a strange error using jQuery 1.3.2 and Firefox. I have created
I have an application where every now and then I'm getting a strange error.
it is very strange, because this error doesn't happen all the time... I have
I am getting some strange behavior involving database queries that I have never seen
I have a bit of a strange problem with MySQL that I've never seen
So I have been doing this awhile now and have run into a really
I am trying to debug a very strange class error by looking at the
I have strange error when I decided to build ordinary web-form validation with classic
I have strange problem with sharepoint and ajax functionality. We have an UpdatePanel placed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.