ASP.NET MVC4 Redirect to login page

前端 未结 6 1228
再見小時候
再見小時候 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条回答
  •  醉酒成梦
    2020-12-09 16:40

    Sure, decorate your actions or the whole class with [Authorize] and it will require that the user is logged in first.

提交回复
热议问题