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 6743533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:58:20+00:00 2026-05-26T11:58:20+00:00

I have a problem with Formsauthentication and my ajax calls. I like the way

  • 0

I have a problem with Formsauthentication and my ajax calls.
I like the way Formsauthenticaction works for a normal asp.net website.

However I have a page in my asp.net website which gets called using AJAX. This page will in some case set the Response StatusCode to Unauthorized (401).

Response.StatusCode = 401;
Response.End();

Now the Response should end and I would like to see this 401 statuscode propagated to the frontend. However Formsauthentication decides otherwise and changes this status to a 302 and redirects to the loginpage.
Thus I can not check for status 401 on my UI.

To inform you further: I am running an asp.net 4.0 website (Not MVC) on IIS 7.

I tried configuring my web.config with following node:

<location path="mypage.aspx">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization>
    </system.web>
</location>

But I guess by setting the Unauthorized status triggers the Formsauthentication module nonetheless.

  • 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-26T11:58:20+00:00Added an answer on May 26, 2026 at 11:58 am

    Here are a few proposed solutions from Phil Haack’s blog.

    Prevent Forms Authentication Login Page Redirect When You Don’t Want It

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

Sidebar

Related Questions

I have a ASP.Net application in my login page I call FormsAuthentication.SignOut Session.Abandon() Session.Clear()
I have a strange problem on my login page in Asp.net this problem only
I have problem with starting processes in impersonated context in ASP.NET 2.0. I am
I'm working with ASP.Net Membership with FormsAuth and have run into a strange problem.
I have a problem with an ASP.NET application that is driving me nuts. When
I currently have an odd problem with ASP.Net authentication. Consider the two following lines:
I am having a problem of a partial page update on Asp.net mvc 3
I have a login page that uses ASP.NET membership. Once I've validated the user
I have two domains, domain1.com and domain2.com pointing at the same asp.net website which
I have the following problem: republishing ASP.NET web app causes (as expected) session resetting

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.