Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Renaud COMTE [MVP]
Effectivement
Voici un petit Sample qui devrais vous aider
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" //Get the current area GUID from the webpart Guid objCurrentAreaGuid = AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
//Get an area object of the current area Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid);
//Get the parent area GUID and make that an area object Guid objParentAreaGuid = objArea.ParentID; Area objParentArea = AreaManager.GetArea(PortalContext.Current, objParentAreaGuid);
//Writes the details of the current area output.Write(" This area is called " +objArea.Title +" <BR>" ); output.Write(" The parent area is called " +objParentArea.Title +" <BR>" );
//Gets the sub-areas of the parent into a collection and writes out each name foreach (Area objSiblingArea in objParentArea.Areas) { output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" ); }
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
//Get the current area GUID from the webpart
Guid objCurrentAreaGuid =
AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
//Get an area object of the current area
Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid);
//Get the parent area GUID and make that an area object
Guid objParentAreaGuid = objArea.ParentID;
Area objParentArea = AreaManager.GetArea(PortalContext.Current,
objParentAreaGuid);
//Writes the details of the current area
output.Write(" This area is called " +objArea.Title +" <BR>" );
output.Write(" The parent area is called " +objParentArea.Title +" <BR>" );
//Gets the sub-areas of the parent into a collection and writes out each name
foreach (Area objSiblingArea in objParentArea.Areas)
{
output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" );
}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" //Get the current area GUID from the webpart Guid objCurrentAreaGuid = AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
//Get an area object of the current area Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid);
//Get the parent area GUID and make that an area object Guid objParentAreaGuid = objArea.ParentID; Area objParentArea = AreaManager.GetArea(PortalContext.Current, objParentAreaGuid);
//Writes the details of the current area output.Write(" This area is called " +objArea.Title +" <BR>" ); output.Write(" The parent area is called " +objParentArea.Title +" <BR>" );
//Gets the sub-areas of the parent into a collection and writes out each name foreach (Area objSiblingArea in objParentArea.Areas) { output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" ); }
Merci pour l'exemple. Maintenant je souhaiterais récupérer les sous-zones d'une zone dans le même ordre défini dans le gestionnaire de site. Si j'itère sur la collection Areas de la classe Area, j'obtiens les sous-zones triées par ordre alphabetique
"Renaud COMTE [MVP]" a écrit :
Effectivement
Voici un petit Sample qui devrais vous aider
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" //Get the current area GUID from the webpart Guid objCurrentAreaGuid = AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
//Get an area object of the current area Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid);
//Get the parent area GUID and make that an area object Guid objParentAreaGuid = objArea.ParentID; Area objParentArea = AreaManager.GetArea(PortalContext.Current, objParentAreaGuid);
//Writes the details of the current area output.Write(" This area is called " +objArea.Title +" <BR>" ); output.Write(" The parent area is called " +objParentArea.Title +" <BR>" );
//Gets the sub-areas of the parent into a collection and writes out each name foreach (Area objSiblingArea in objParentArea.Areas) { output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" ); }
Merci pour l'exemple.
Maintenant je souhaiterais récupérer les sous-zones d'une zone dans le même
ordre défini dans le gestionnaire de site. Si j'itère sur la collection Areas
de la classe Area, j'obtiens les sous-zones triées par ordre alphabetique
"Renaud COMTE [MVP]" a écrit :
Effectivement
Voici un petit Sample qui devrais vous aider
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
//Get the current area GUID from the webpart
Guid objCurrentAreaGuid =
AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
//Get an area object of the current area
Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid);
//Get the parent area GUID and make that an area object
Guid objParentAreaGuid = objArea.ParentID;
Area objParentArea = AreaManager.GetArea(PortalContext.Current,
objParentAreaGuid);
//Writes the details of the current area
output.Write(" This area is called " +objArea.Title +" <BR>" );
output.Write(" The parent area is called " +objParentArea.Title +" <BR>" );
//Gets the sub-areas of the parent into a collection and writes out each name
foreach (Area objSiblingArea in objParentArea.Areas)
{
output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" );
}
Merci pour l'exemple. Maintenant je souhaiterais récupérer les sous-zones d'une zone dans le même ordre défini dans le gestionnaire de site. Si j'itère sur la collection Areas de la classe Area, j'obtiens les sous-zones triées par ordre alphabetique
"Renaud COMTE [MVP]" a écrit :
Effectivement
Voici un petit Sample qui devrais vous aider
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" //Get the current area GUID from the webpart Guid objCurrentAreaGuid = AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
//Get an area object of the current area Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid);
//Get the parent area GUID and make that an area object Guid objParentAreaGuid = objArea.ParentID; Area objParentArea = AreaManager.GetArea(PortalContext.Current, objParentAreaGuid);
//Writes the details of the current area output.Write(" This area is called " +objArea.Title +" <BR>" ); output.Write(" The parent area is called " +objParentArea.Title +" <BR>" );
//Gets the sub-areas of the parent into a collection and writes out each name foreach (Area objSiblingArea in objParentArea.Areas) { output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" ); }
Une fois le portal context de charger , je pense qu'il faut recuperer l'ensemble des Area dans un collection puis vous effectuer un tri personnlaiser via une classe implementant Icomparable pour comparer la propriété "Order"
Merci pour l'exemple. Maintenant je souhaiterais récupérer les sous-zones d'une zone dans le même ordre défini dans le gestionnaire de site. Si j'itère sur la collection Areas de la classe Area, j'obtiens les sous-zones triées par ordre alphabetique
"Renaud COMTE [MVP]" a écrit :
> Effectivement > > Voici un petit Sample qui devrais vous aider > > """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" > //Get the current area GUID from the webpart > Guid objCurrentAreaGuid = > AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics); > > //Get an area object of the current area > Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid); > > //Get the parent area GUID and make that an area object > Guid objParentAreaGuid = objArea.ParentID; > Area objParentArea = AreaManager.GetArea(PortalContext.Current, > objParentAreaGuid); > > //Writes the details of the current area > output.Write(" This area is called " +objArea.Title +" <BR>" ); > output.Write(" The parent area is called " +objParentArea.Title +" <BR>" ); > > //Gets the sub-areas of the parent into a collection and writes out each name > foreach (Area objSiblingArea in objParentArea.Areas) > { > output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" ); > } > > """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" > > Renaud COMTE [MVP] >
Une fois le portal context de charger , je pense qu'il faut recuperer
l'ensemble des Area dans un collection puis vous effectuer un tri
personnlaiser via une classe implementant Icomparable pour comparer la
propriété "Order"
Merci pour l'exemple.
Maintenant je souhaiterais récupérer les sous-zones d'une zone dans le même
ordre défini dans le gestionnaire de site. Si j'itère sur la collection Areas
de la classe Area, j'obtiens les sous-zones triées par ordre alphabetique
"Renaud COMTE [MVP]" a écrit :
> Effectivement
>
> Voici un petit Sample qui devrais vous aider
>
> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
> //Get the current area GUID from the webpart
> Guid objCurrentAreaGuid =
> AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
>
> //Get an area object of the current area
> Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid);
>
> //Get the parent area GUID and make that an area object
> Guid objParentAreaGuid = objArea.ParentID;
> Area objParentArea = AreaManager.GetArea(PortalContext.Current,
> objParentAreaGuid);
>
> //Writes the details of the current area
> output.Write(" This area is called " +objArea.Title +" <BR>" );
> output.Write(" The parent area is called " +objParentArea.Title +" <BR>" );
>
> //Gets the sub-areas of the parent into a collection and writes out each name
> foreach (Area objSiblingArea in objParentArea.Areas)
> {
> output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" );
> }
>
> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
>
> Renaud COMTE [MVP]
>
Une fois le portal context de charger , je pense qu'il faut recuperer l'ensemble des Area dans un collection puis vous effectuer un tri personnlaiser via une classe implementant Icomparable pour comparer la propriété "Order"
Merci pour l'exemple. Maintenant je souhaiterais récupérer les sous-zones d'une zone dans le même ordre défini dans le gestionnaire de site. Si j'itère sur la collection Areas de la classe Area, j'obtiens les sous-zones triées par ordre alphabetique
"Renaud COMTE [MVP]" a écrit :
> Effectivement > > Voici un petit Sample qui devrais vous aider > > """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" > //Get the current area GUID from the webpart > Guid objCurrentAreaGuid = > AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics); > > //Get an area object of the current area > Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid); > > //Get the parent area GUID and make that an area object > Guid objParentAreaGuid = objArea.ParentID; > Area objParentArea = AreaManager.GetArea(PortalContext.Current, > objParentAreaGuid); > > //Writes the details of the current area > output.Write(" This area is called " +objArea.Title +" <BR>" ); > output.Write(" The parent area is called " +objParentArea.Title +" <BR>" ); > > //Gets the sub-areas of the parent into a collection and writes out each name > foreach (Area objSiblingArea in objParentArea.Areas) > { > output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" ); > } > > """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" > > Renaud COMTE [MVP] >
Damien MINART
Je suis intéressé par ce genre de fonction j'ai donc essayé ce code malheureusement j'ai un message d'erreur :
cateogry not found
a priori sur la première ligne : //Get the current area GUID from the webpart
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" //Get the current area GUID from the webpart Guid objCurrentAreaGuid = AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
//Get an area object of the current area Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid);
//Get the parent area GUID and make that an area object Guid objParentAreaGuid = objArea.ParentID; Area objParentArea = AreaManager.GetArea(PortalContext.Current, objParentAreaGuid);
//Writes the details of the current area output.Write(" This area is called " +objArea.Title +" <BR>" ); output.Write(" The parent area is called " +objParentArea.Title +" <BR>" );
//Gets the sub-areas of the parent into a collection and writes out each name foreach (Area objSiblingArea in objParentArea.Areas) { output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" ); }
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
//Get the current area GUID from the webpart
Guid objCurrentAreaGuid =
AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
//Get an area object of the current area
Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid);
//Get the parent area GUID and make that an area object
Guid objParentAreaGuid = objArea.ParentID;
Area objParentArea = AreaManager.GetArea(PortalContext.Current,
objParentAreaGuid);
//Writes the details of the current area
output.Write(" This area is called " +objArea.Title +" <BR>" );
output.Write(" The parent area is called " +objParentArea.Title +" <BR>" );
//Gets the sub-areas of the parent into a collection and writes out each name
foreach (Area objSiblingArea in objParentArea.Areas)
{
output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" );
}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" //Get the current area GUID from the webpart Guid objCurrentAreaGuid = AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
//Get an area object of the current area Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid);
//Get the parent area GUID and make that an area object Guid objParentAreaGuid = objArea.ParentID; Area objParentArea = AreaManager.GetArea(PortalContext.Current, objParentAreaGuid);
//Writes the details of the current area output.Write(" This area is called " +objArea.Title +" <BR>" ); output.Write(" The parent area is called " +objParentArea.Title +" <BR>" );
//Gets the sub-areas of the parent into a collection and writes out each name foreach (Area objSiblingArea in objParentArea.Areas) { output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" ); }
Je suis intéressé par ce genre de fonction j'ai donc essayé ce code malheureusement j'ai un message d'erreur :
cateogry not found
a priori sur la première ligne : //Get the current area GUID from the webpart > Guid objCurrentAreaGuid = > AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
(oui, oui avec la faute de frappe)
Savez-vous d'où cela peut-il venir ?
"Renaud COMTE [MVP]" a écrit :
> Effectivement > > Voici un petit Sample qui devrais vous aider > > """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" > //Get the current area GUID from the webpart > Guid objCurrentAreaGuid = > AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics); > > //Get an area object of the current area > Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid); > > //Get the parent area GUID and make that an area object > Guid objParentAreaGuid = objArea.ParentID; > Area objParentArea = AreaManager.GetArea(PortalContext.Current, > objParentAreaGuid); > > //Writes the details of the current area > output.Write(" This area is called " +objArea.Title +" <BR>" ); > output.Write(" The parent area is called " +objParentArea.Title +" <BR>" ); > > //Gets the sub-areas of the parent into a collection and writes out each name > foreach (Area objSiblingArea in objParentArea.Areas) > { > output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" ); > } > > """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" > > Renaud COMTE [MVP] >
J'ai utilisé finalement cette ligne pour récupérer l'ID :
Je suis intéressé par ce genre de fonction j'ai donc essayé ce code
malheureusement j'ai un message d'erreur :
cateogry not found
a priori sur la première ligne :
//Get the current area GUID from the webpart
> Guid objCurrentAreaGuid =
> AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
(oui, oui avec la faute de frappe)
Savez-vous d'où cela peut-il venir ?
"Renaud COMTE [MVP]" a écrit :
> Effectivement
>
> Voici un petit Sample qui devrais vous aider
>
> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
> //Get the current area GUID from the webpart
> Guid objCurrentAreaGuid =
> AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
>
> //Get an area object of the current area
> Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid);
>
> //Get the parent area GUID and make that an area object
> Guid objParentAreaGuid = objArea.ParentID;
> Area objParentArea = AreaManager.GetArea(PortalContext.Current,
> objParentAreaGuid);
>
> //Writes the details of the current area
> output.Write(" This area is called " +objArea.Title +" <BR>" );
> output.Write(" The parent area is called " +objParentArea.Title +" <BR>" );
>
> //Gets the sub-areas of the parent into a collection and writes out each name
> foreach (Area objSiblingArea in objParentArea.Areas)
> {
> output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" );
> }
>
> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
>
> Renaud COMTE [MVP]
>
Je suis intéressé par ce genre de fonction j'ai donc essayé ce code malheureusement j'ai un message d'erreur :
cateogry not found
a priori sur la première ligne : //Get the current area GUID from the webpart > Guid objCurrentAreaGuid = > AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics);
(oui, oui avec la faute de frappe)
Savez-vous d'où cela peut-il venir ?
"Renaud COMTE [MVP]" a écrit :
> Effectivement > > Voici un petit Sample qui devrais vous aider > > """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" > //Get the current area GUID from the webpart > Guid objCurrentAreaGuid = > AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Topics); > > //Get an area object of the current area > Area objArea = AreaManager.GetArea(PortalContext.Current, objCurrentAreaGuid); > > //Get the parent area GUID and make that an area object > Guid objParentAreaGuid = objArea.ParentID; > Area objParentArea = AreaManager.GetArea(PortalContext.Current, > objParentAreaGuid); > > //Writes the details of the current area > output.Write(" This area is called " +objArea.Title +" <BR>" ); > output.Write(" The parent area is called " +objParentArea.Title +" <BR>" ); > > //Gets the sub-areas of the parent into a collection and writes out each name > foreach (Area objSiblingArea in objParentArea.Areas) > { > output.Write(" Sibling: " +objSiblingArea.Title +" <BR>" ); > } > > """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" > > Renaud COMTE [MVP] >