Vipul Limbachiya
Vipul Limbachiya

Reputation: 131

Suggest me best role based authentication/authorization method in asp.net that can work control level

I am in need of best method to achieve role based authentication/authorization. The requirements are

I am familiar with asp.net native membership facility and as far as I know it can help to achieve authorization up to page level, I do not have idea if there is anything that can work control level.

Or I will have to place code User.IsInRole("Admin") everywhere on pages to show/hide controls?

Thanks,

Vipul

Upvotes: 1

Views: 1134

Answers (1)

Adam Houldsworth
Adam Houldsworth

Reputation: 64487

Forms Authentication does exactly this. There are ASP.NET controls for showing and hiding content based on the current user principal.

I believe the control is called LoginView or something similar:

http://msdn.microsoft.com/en-us/library/ms178329.aspx

Upvotes: 2

Related Questions