开发者

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜