ASP.NET MVC4 Redirect to login page

前端 未结 6 1229
再見小時候
再見小時候 2020-12-09 15:53

I\'m creating a web application using ASP.NET MVC 4 and C#.

I want all users to be logged in before using application.

I\'m using ASP.NET Membership with a c

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-09 16:36

    Use [Authorize] at the class level

    if you want to allow anonymous access to some actions use [AllowAnonymous]

提交回复
热议问题