BootstrapExtensions.Base.HtmlListItem.Active C# (CSharp) Method

Active() public method

public Active ( bool condition = true ) : HtmlListItem
condition bool
return HtmlListItem
        public HtmlListItem Active(bool condition = true)
        {
            _active = condition;
            return this;
        }

Usage Example

Exemplo n.º 1
0
        public HtmlListItem Link(string text, string url, object htmlAttributes, string identifier = null)
        {
            var attrs      = new HtmlAttributes(htmlAttributes);
            var link       = new HtmlListItem(string.Format("<a href=\"{0}\" {2}>{1}</a>", url, text, attrs));
            var currActive = _list.HtmlAttributes["data-activeLink"];

            if (!string.IsNullOrEmpty(identifier) && currActive == identifier)
            {
                link.Active();
            }
            _list.ListItems.Add(link);
            return(link);
        }
All Usage Examples Of BootstrapExtensions.Base.HtmlListItem::Active