Esempio n. 1
0
        private string DisplaySiteMapLevelAsBulletedList()
        {
            //Get the SiteMapDataSourceView from the siteMapData SiteMapDataSource
            SiteMapDataSourceView siteMapView = (SiteMapDataSourceView)SiteMapDataSource1.GetView(string.Empty);

            //Get the SiteMapNodeCollection from the SiteMapDataSourceView
            SiteMapNodeCollection nodes = (SiteMapNodeCollection)siteMapView.Select(DataSourceSelectArguments.Empty);

            //Recurse through the SiteMapNodeCollection...
            return(GetSiteMapLevelAsBulletedList(nodes));
        }
Esempio n. 2
0
        /// <summary>
        /// Render out the bulleted List.
        /// </summary>
        /// <param name="writer">Html Text Writer</param>
        protected override void Render(HtmlTextWriter writer)
        {
            int depthTravelled = 0;

            SiteMapDataSourceView view  = (SiteMapDataSourceView)this.DataSource.GetView(String.Empty);
            SiteMapNodeCollection nodes = (SiteMapNodeCollection)view.Select(DataSourceSelectArguments.Empty);

            writer.RenderBeginTag(HtmlTextWriterTag.Ul);

            if (this.DataSource != null)
            {
                this.RenderSiteMapLevelAsBulletedList(writer, nodes, depthTravelled);
            }

            writer.RenderEndTag();
        }