Bypass Forms Authentication auto redirect to login, How to?

后端 未结 5 1425
臣服心动
臣服心动 2021-02-09 19:37

I\'m writing an app using asp.net-mvc deploying to iis6. I\'m using forms authentication. Usually when a user tries to access a resource without proper authorization I want them

5条回答
  •  死守一世寂寞
    2021-02-09 20:16

    I did some googling and this is what I came up with:

    
        HttpContext.Current.Response.StatusCode = 401;
    

    Not sure if it works or not, I haven't tested it. Either way, it's worth a try, right? :)

提交回复
热议问题