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?
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?
You should read about [Authorize] attribute and propably 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.
This and other q's answered in the nerd dinner tutorial. It's worth an afternoon going through. http://tinyurl.com/aspnetmvc (It's free)