protected void Page_Load(object sender, EventArgs e) { var context = new IdentityDb(); if (!(context.GetUserRole(Context.User.Identity.GetUserId()) == CustomRoles.roles.Prof.ToString())) { Button2.Visible = false; } else { Button2.Visible = true; } }