Prevent ASP.NET from redirecting to login.aspx

前端 未结 2 1543
面向向阳花
面向向阳花 2020-12-28 23:33

We have a website that runs fully on AngularJS with an ASP.NET Web API back-end with the following configuration: - HTML5 routing is enabled on Angular and there is a rewrit

2条回答
  •  有刺的猬
    2020-12-29 00:24

    If you are using ASP.NET 4.5. you can disable forms authentication redirect HttpResponse.SuppressFormsAuthenticationRedirect property.

    In Global.asax:

    protected void Application_BeginRequest(Object sender, EventArgs e)
    {
            HttpApplication context = (HttpApplication)sender;
            context.Response.SuppressFormsAuthenticationRedirect = true;
    }
    

提交回复
热议问题