Reputation: 69
I have following role in my application, User, Visitor and Admin. In my application i want to give access for delete button to User and Admin and not to User in ASP .net. How would i implement this functionality?
Upvotes: 0
Views: 426
Reputation: 35514
You can use IsInRole
if (User.IsInRole("Admin") || User.IsInRole("User"))
{
Button1.Enabled = true;
}
else
{
Button1.Enabled = false;
}
Upvotes: 1