I am using asp.net mvc4 to create authentication and authorization application ,and i have created a common login page for all users in different roles(authentication and authorization is based on role),it should ask for username and password and when we click on login button it should check the user's role in database,and i am checking that as in below code
But here its not entering in the if part,and also i have checked using add watch so it say's: IsUserInRole -The name 'IsUserInRole' does not exist in the current context
I am using simple membership provider and want to built application using built-in methods and i have configured all in web.config
I am not able to figure whats the problem,i have read/searched many articles,any help would be greatly appreciated, pls help me.
if(Roles.IsUserInRole(WebSecurity.CurrentUserName,"Admin"))
{
RedirectToAction("Admin","Home");
}