Refresh Software Support Center

Contact Support
 

Email:
support@refreshsoftware.com

Phone:
508-318-4480


  Link to this page

Home >  Publishing Examples >  dotNET C# (.aspx) >  DotNet Breadcrumb code

DotNet Breadcrumb code

 

BreadcrumbLabel.Text = GetBreadcrumb(contentAsset);

where contentAsset is the current page's asset

         public string GetBreadcrumb(ContentAsset asset)

        {return GetBreadcrumbHelper(asset) + "</ul>";

        }

        private string GetBreadcrumbHelper(ContentAsset asset)

        {string html = "<li><a href=\"" + asset.Link + "\">" + asset.Title + "</a></li>";

            if (asset.Parent == null || asset.Parent == string.Empty)

            { html = "<ul>" + html;

            }

            else

            { html = GetBreadcrumbHelper(contentDomain.GetContentAssetByName(asset.Parent)) + html;

            }

 return html;

        }