Example #1
0
        private TagBuilder GetLi(IRelationship <T> item)
        {
            var li = new TagBuilder("li")
            {
                InnerHtml = itemTemplate(item).ToHtmlString()
            };

            if (item.Any())
            {
                li.MergeAttributes(itemWithChildrenHtmlAttributes);
            }

            return(li);
        }
Example #2
0
        private void AppendChildren(TagBuilder parentTag, IRelationship <T> parentItem)
        {
            if (!parentItem.Any())
            {
                return;
            }

            var innerUl = new TagBuilder("ul");

            innerUl.MergeAttributes(childHtmlAttributes);

            foreach (var item in parentItem)
            {
                BuildNestedTag(innerUl, item);
            }

            parentTag.InnerHtml += innerUl.ToString();
        }