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 custom database.
One method is check if Membership.GetUser()
is null or not in every function.
But isn't there any easier way than checking user login state in every function? (maybe checking in web.config, global.asax, etc...??)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…