Reputation: 103517
some actions shouldn't be run unless the user is logged in.
I just want to do something like:
[MustBeLoggedIn] public ActionResult Blah() { }
is that hard?
Upvotes: 0
Views: 77
Reputation: 31842
You should read about [Authorize] attribute and probably FormsAuthentication.
This blog entry shows overview:
ASP.NET 2.0 Forms authentication - Keeping it customized yet simple
This is another page about forms authentication:
Explained: Forms Authentication in ASP.NET 2.0
When you use forms authentication, set IPrincipal in proper place [Authorize] attribute will do what you want.
Upvotes: 3
Reputation: 8336
This and other q's answered in the nerd dinner tutorial. It's worth an afternoon going through. (It's free)
Upvotes: 1