I have implemented role-based security within my ASP.Net application.
However, it seems the role is not passed to the authentication ticket I
I want to use it to display/hide some content based on the user's role. I
wrote this to do it:
if (HttpContext.Current.User.Identity.IsAuthenticated )
plLoggedIn.Visible = true;
liFirstName.Text = HttpContext.Current.User.Identity.Name;
// This condition is causing me problems.
// The condition always returns false, and hence writes
// "user" regardless of what I log on as.
if (HttpContext.Current.User.IsInRole("Administrator" ))
liUserRole.Text = "administrator";
liUserRole.Text = "user";
plLogin.Visible = true; // if ...