public static ContentBox ContentBox(this HtmlHelper htmlHelper, string title, bool showDefaultTabContainer, params object[] tabs) { StringBuilder tabsCollection = new StringBuilder(); foreach (var tab in tabs) { tabsCollection.AppendFormat("<li>{0}</li>", tab); } var header = ($@" <div class=""content-box""> <!-- Start Content Box --> <div class=""content-box-header""> <h3> {title}</h3> <ul class=""content-box-tabs {tabsCollection}""> {(tabsCollection.Length == 0 ? "hide" : "")} </ul> <div class=""clear""> </div> </div> <!-- End .content-box-header --> <div class=""content-box-content"">" + (showDefaultTabContainer ? @" <div class=""tab-content default-tab"" id=""tab1""> <!-- This is the target div. id must match the href of this div's tab -->" : "")); htmlHelper.ViewContext.Writer.Write(header); ContentBox contentBox = new ContentBox(htmlHelper.ViewContext, showDefaultTabContainer); return(contentBox); }
public static ContentBox ContentBox(this HtmlHelper htmlHelper, string title, bool showDefaultTabContainer, params object[] tabs) { StringBuilder tabsCollection = new StringBuilder(); foreach (var tab in tabs) { tabsCollection.AppendFormat("{0}", tab); } var header = (@" <div class=""widget""> <div class=""widget-header with-footer""> <span class=""widget-caption"">{0}</span> <div class=""widget-buttons {2}""> {1} </div> </div> <div class=""widget-body"">") .With(title, tabsCollection, tabsCollection.Length == 0 ? "hide" : ""); htmlHelper.ViewContext.Writer.Write(header); ContentBox contentBox = new ContentBox(htmlHelper.ViewContext, showDefaultTabContainer); return(contentBox); }