SPQuery strQuery = new SPQuery();
strQuery.RowLimit = 1;
//Retrieve the items for the specified Target location from the Target list
strQuery.Query = "CAML query...
PortalSiteMapProvider ps = PortalSiteMapProvider.WebSiteMapProvider;
PortalWebSiteMapNode pNode = ps.FindSiteMapNode(web.ServerRelativeUrl) as PortalWebSiteMapNode;
SiteMapNodeCollection pItems = new SiteMapNodeCollection();
pItems = ps.GetCachedListItemsByQuery(pNode, "targetListName", strQuery, web);
//Check if there are items for the specified target location
if (pItems.Count != 0)
{
try
{
//Retrieve the most recently created item for the specified Target location from the list
foreach (PortalListItemSiteMapNode pItem in pItems)
{//TODO}
catch (Exception ex)
{}
}
No comments:
Post a Comment