Exemple #1
0
 public static string RenderTabs(this HtmlHelper htmlHelper, string[] tabsIds, TabsTypes tabsType)
 {
     switch (tabsType)
     {
         case TabsTypes.Recommendation:
             return RenderTabs(htmlHelper, tabsIds, new {  });
         case TabsTypes.DefaultFuntionality:
             return RenderTabs(htmlHelper, tabsIds, new { });
         default:    // Recommendation
             return RenderTabs(htmlHelper, tabsIds, new { });
     }
 }
Exemple #2
0
        public static string Tabs(this HtmlHelper htmlHelper, string id, string[] title, string[] content, TabsTypes tabsType, object htmlAttributes, bool withoutScript)
        {
            // Create tag builder
            var builder = new TagBuilder("div");

            // Create valid id
            builder.GenerateId(id);

            // Add attributes
            builder.MergeAttributes(new RouteValueDictionary(htmlAttributes));

            // title
            builder.InnerHtml += "<ul>";
            int i = 1;

            foreach (var t in title)
            {
                builder.InnerHtml += string.Format("<li><a href=\"#{0}_tabs-{1}\">{2}</a></li>", id, i++, t);
            }
            builder.InnerHtml += "</ul>";

            // content
            i = 1;
            foreach (var c in content)
            {
                builder.InnerHtml += string.Format("<div id=\"#{0}_tabs-{1}\">{2}</div>", id, i++, c);
            }

            // Render tag
            return(builder.ToString(TagRenderMode.Normal)
                   + (withoutScript == true ? string.Empty : "\n    " + RenderTabs(htmlHelper, new string[] { id }, tabsType)));
        }
Exemple #3
0
 public static string Tabs(this HtmlHelper htmlHelper, string id, string[] title, string[] content, TabsTypes tabsType, object htmlAttributes)
 {
     return(Tabs(htmlHelper, id, title, content, tabsType, htmlAttributes, false /*withoutScript*/));
 }
Exemple #4
0
 public static string Tabs(this HtmlHelper htmlHelper, string id, string[] title, string[] content, TabsTypes tabsType, bool withoutScript)
 {
     return(Tabs(htmlHelper, id, title, content, tabsType, null /*htmlAttributes*/, withoutScript));
 }
Exemple #5
0
        public static string RenderTabs(this HtmlHelper htmlHelper, string[] tabsIds, TabsTypes tabsType)
        {
            switch (tabsType)
            {
            case TabsTypes.Recommendation:
                return(RenderTabs(htmlHelper, tabsIds, new {  }));

            case TabsTypes.DefaultFuntionality:
                return(RenderTabs(htmlHelper, tabsIds, new { }));

            default:        // Recommendation
                return(RenderTabs(htmlHelper, tabsIds, new { }));
            }
        }
Exemple #6
0
        public static string Tabs(this HtmlHelper htmlHelper, string id, string[] title, string[] content, TabsTypes tabsType, object htmlAttributes, bool withoutScript)
        {
            // Create tag builder
            var builder = new TagBuilder("div");

            // Create valid id
            builder.GenerateId(id);

            // Add attributes
            builder.MergeAttributes(new RouteValueDictionary(htmlAttributes));

            // title
            builder.InnerHtml += "<ul>";
            int i = 1;
            foreach (var t in title)
            {
                builder.InnerHtml += string.Format("<li><a href=\"#{0}_tabs-{1}\">{2}</a></li>",id, i++, t);
            }
            builder.InnerHtml += "</ul>";

            // content
            i = 1;
            foreach (var c in content)
            {
                builder.InnerHtml += string.Format("<div id=\"#{0}_tabs-{1}\">{2}</div>",id, i++, c);
            }

            // Render tag
            return builder.ToString(TagRenderMode.Normal)
                + (withoutScript == true ? string.Empty : "\n    " + RenderTabs(htmlHelper, new string[] { id }, tabsType));
        }
Exemple #7
0
 public static string Tabs(this HtmlHelper htmlHelper, string id, string[] title, string[] content, TabsTypes tabsType, object htmlAttributes)
 {
     return Tabs(htmlHelper, id, title, content, tabsType, htmlAttributes, false/*withoutScript*/);
 }
Exemple #8
0
 public static string Tabs(this HtmlHelper htmlHelper, string id, string[] title, string[] content, TabsTypes tabsType, bool withoutScript)
 {
     return Tabs(htmlHelper, id, title, content, tabsType, null/*htmlAttributes*/, withoutScript);
 }