string[] rolesArray; public void Page_Load() { RolePrincipal r = (RolePrincipal)User; rolesArray = r.GetRoles(); ...//extra code }