I have went through and put in web.config files in each folder giving specific roles access or not. Now whenever a user tries to go to a page that they don't have access to, they get redirected to the login page. How do I change that to a generic "sorry you don't have permissions to see this page" page? Also, what is wrong with this if statement I want to redirect the user if they are not either a site admin or a super admin
If Not ((Roles.IsUserInRole(Membership.GetUser.UserName, "SiteAdmin")) Or ((Roles.IsUserInRole(Membership.GetUser.UserName, "SuperAdmin")))) Then
Response.Redirect("PermissionsError.aspx")
End If ' if not roles
I get an error saying that the specified cast is not valid.