http://aspnetcoe.wordpress.com/2006/09/28/moss-2007-wcm-development-part-1/
private void TraverseUp(SiteMapNode currentNode, Stack linkStack)
{
if (currentNode != null)
{
HyperLink currentLink = new HyperLink();
currentLink.Text = currentNode.Title;
currentLink.NavigateUrl = currentNode.Url;
currentLink.Attributes.Add("alt", currentNode.Description);
linkStack.Push(currentLink);
if (currentNode.ParentNode != null)
{
TraverseUp(currentNode.ParentNode, linkStack);
}
}
}
private void TraverseUp(SiteMapNode currentNode, Stack linkStack)
{
if (currentNode != null)
{
HyperLink currentLink = new HyperLink();
currentLink.Text = currentNode.Title;
currentLink.NavigateUrl = currentNode.Url;
currentLink.Attributes.Add("alt", currentNode.Description);
linkStack.Push(currentLink);
if (currentNode.ParentNode != null)
{
TraverseUp(currentNode.ParentNode, linkStack);
}
}
}
No comments:
Post a Comment