I created a Button on the ribbon "SelectCp".
OnClick of the button I am launching a custom aspx page.
Custom aspx page is having a dropdown with the items like.
- Select CP
- Etc
Now, when user will select the option "Select CP", I need to populate all the publication in a listitem on the aspx page. When user will select a publication, I need to populate all the component in another list.
Can anyone give an idea how to proceed?
ADDED
I am proceeding Like this, but its not giving the list of publication in the listbox on the aspx page.
protected void ddSelectOption_SelectedIndexChanged(object sender, EventArgs e)
{
//CommonTridionTools objCmnUnPub = new CommonTridionTools();
CoreServiceSession client = new CoreServiceSession();
SessionAwareCoreServiceClient csClient = client.GetClient();
ReadOptions readoption = new ReadOptions();
List<string> PublicationList = new List<string>();
List<string> ComponentList = new List<string>();
if (ddSelectOption.SelectedItem.Equals("Select CP"))
{
FolderData RootFolder =(FolderData)csClient.Read(tridionPageId, readoption);
var filter = new OrganizationalItemItemsFilterData
{
Recursive = true,
ItemTypes = new ItemType[] { ItemType.Publication,ItemType.Component, ItemType.ComponentTemplate },
};
XElement CompList = csClient.GetListXml(RootFolder.Id,filter);
foreach (var comp in CompList.Elements())
{
PublicationData Publication =(PublicationData)csClient.Read(comp.Attribute("ID").Value, readoption);
var MetadataXML = new XmlDocument();
MetadataXML.LoadXml(Publication.Metadata);
PublicationList.Add(Publication.Id)
lbPublication.DataSource = PublicationList;
}
}