zSynopsis
zSynopsis

Reputation: 4854

Custom Authentication on a Controllers Action Methods

I'm new to asp.net mvc and I was wondering if there was any clean non repetitive way of running a check to see whether a user is logged in when any Action Method on a particular controller is invoked? Also is there a way to stop that method from being invoked and redirecting the user to a specified page? I'm using a custom authentication method (not Membership Provider) and i'm having trouble finding examples for this type of implementation.

Thanks in advance

Upvotes: 0

Views: 293

Answers (1)

Rudy
Rudy

Reputation: 895

Check the [Authorize] attribute System.Web.Mvc.AuthorizeAttribute. Also, the template ASP.NET MVC application created in Visual Studio contains a controller illustrating authorization/authentication techniques.

Upvotes: 1

Related Questions