private BreadcrumbItemCollection BuildDefaultItems() { BreadcrumbItemCollection result = new BreadcrumbItemCollection(); if (this.Channel != null) { result.Add(new BreadcrumbItem() { Name = this.Channel.Name, Url = "~/list/AllChannels.aspx" }); if (this.Event != null) { result.Add(new BreadcrumbItem() { Name = "事件列表", Url = string.Format("~/list/EventsInChannel.aspx?channelID={0}", this.Channel.ID) }); } } if (this.CurrentName.IsNotEmpty()) { result.Add(new BreadcrumbItem() { Name = this.CurrentName, Url = string.Empty }); } return(result); }
private void RenderBreadcrumbTrail() { this.header.Controls.Clear(); BreadcrumbItemCollection items = this.Items; if (items.Count == 0) { items = BuildDefaultItems(); } items.ForEach(item => AddItem(this.header, item.Name, this.ResolveUrl(item.Url))); }
private BreadcrumbItemCollection BuildDefaultItems() { BreadcrumbItemCollection result = new BreadcrumbItemCollection(); if (this.Channel != null) { result.Add(new BreadcrumbItem() { Name = this.Channel.Name, Url = "~/list/AllChannels.aspx" }); if (this.Event != null) result.Add(new BreadcrumbItem() { Name = "事件列表", Url = string.Format("~/list/EventsInChannel.aspx?channelID={0}", this.Channel.ID) }); } if (this.CurrentName.IsNotEmpty()) result.Add(new BreadcrumbItem() { Name = this.CurrentName, Url = string.Empty }); return result; }