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

  • SEARCH
  • Home
  • 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 3339930
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:32:57+00:00 2026-05-18T00:32:57+00:00

I have an ASP.NET MVC 3 Beta application running on IIS. In my web.config

  • 0

I have an ASP.NET MVC 3 Beta application running on IIS. In my web.config I defined following section responsible for forms authentication:

<authentication mode="Forms">
    <forms 
        loginUrl="~/Account/LogOn" 
        name=".VNK" 
        protection="All" 
        timeout="43200" 
        cookieless="UseCookies" />
</authentication>

The defined login address is ~/Account/LogOn.

When I try to get the login url using:

FormsAuthentication.Initialize();
string loginUrl = FormsAuthentication.LoginUrl; 

I receive: /VNK/site/Account/Login

Why do I get a different address from the one defined in web.config?

UPDATE: The “/VNK/site/” prefix is not a problem here. The problem is that LoginUrl property of FormsAuthentication class does not reflect the value from web.config. It means that if I change the value of loginUrl attribute in web.config from “~/Account/LogOn” to e.g. “~/foobar”, FormsAuthentication.LoginUrl still has value of “/VNK/site/Account/Login”. Why ?

  • 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-18T00:32:58+00:00Added an answer on May 18, 2026 at 12:32 am

    I think there is a bug in ASP.NET MVC 3 Beta. This problem does not appear in previous releases of ASP.NET MVC.

    If anyone wants to replay this error, he should follow this:

    1.Download the mvc framevork.

    2.Create new ASP.NET MVC 3 Web Application

    3.Applay Authorize attribute on About action in HomeController

    [Authorize]
    public ActionResult About()
    {
       return View();
    }  
    

    4.Start application and invoke About action by clicking on About tab. You will get server error, because application is trying to redirect You to such URL:

    http://localhost:%5Bport_num%5D/Account/Login?ReturnUrl=%2fHome%2fAbout

    There is obviously no Login view. There is LogOn view. Url to LogOn action is defined in untouched web.config:

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

    But application does not reflect that. Have anyone any clue what’s going on ?

    UPDATE:

    I was right, there is a bug in MVC 3 Beta. From known issues:

    “There’s a known issue that causes Forms Authentication to always redirect unauthenticated users to /Account/Login, ignoring the forms authentication setting used in Web.config. The workaround is to add the following app setting.”

    <add key="autoFormsAuthentication" value="false" />
    

    UPDATE 2:

    Alexander Prokofyev noticed, that ASP.NET 3 RTM looks for another setting. So you need this line instead:

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

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

Sidebar

Related Questions

I have asp.net mvc 4 web application project on my server in IIS Directory.
I have ASP.NET MVC Beta on our web server running a few apps. My
I have recently upgraded my ASP.NET MVC application from beta to version 1. And
I am running ASP.NET MVC Beta. I have an AJAX call running through jQuery
I have an ASP.NET MVC (beta) application that I'm working on, and am having
I have created a custom attribute in my asp.net MVC application using the following
I have a small ASP.NET MVC application developed using the latest beta version. What
In ASP.NET MVC 4 Beta, I have an entity with this property: [DisplayFormat(DataFormatString =
I have an ASP.NET MVC application. I am having multiple drop-down list in my
I have an ASP.NET MVC 3 app hosted on IIS. This app is using

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.