Example #1
0
        public static string RenderHtml(string text, eType type, eSize size, string cssClass = "", string onClientClick = "", string href = "javascript:void(0);", string rel = "", string target = "")
        {
            StringBuilder res = new StringBuilder();

            res.Append("<span class=\"btn-c\">");

            cssClass = string.Format("btn{0}{1}{2}", type != eType.None ? " btn-" + type.ToString().ToLower() : string.Empty,
                                     size != eSize.None ? " btn-" + size.ToString().ToLower() : string.Empty,
                                     cssClass.IsNotEmpty() ? " " + cssClass : string.Empty);

            res.AppendFormat("<a class=\"{0}\" href=\"{1}\" {2}{3}{5}>{4}</a>",
                             cssClass,
                             href,
                             onClientClick.IsNotEmpty() ? "onclick=\"" + onClientClick + "\"" : string.Empty,
                             rel.IsNotEmpty() ? "rel=\"" + rel + "\"" : string.Empty,
                             text,
                             target.IsNotEmpty() ? "target='" + target : string.Empty
                             );
            res.Append("</span>");

            return(res.ToString());
        }
Example #2
0
        public static string RenderHtml(string text, eType type, eSize size, string cssClass = "", string onClientClick = "", string href = "javascript:void(0);", string rel = "", string target = "")
        {
            StringBuilder res = new StringBuilder();
            res.Append("<span class=\"btn-c\">");

            cssClass = string.Format("btn{0}{1}{2}", type != eType.None ? " btn-" + type.ToString().ToLower() : string.Empty,
                                                            size != eSize.None ? " btn-" + size.ToString().ToLower() : string.Empty,
                                                            cssClass.IsNotEmpty() ? " " + cssClass : string.Empty);

            res.AppendFormat("<a class=\"{0}\" href=\"{1}\" {2}{3}{5}>{4}</a>",
                                                                cssClass,
                                                                href,
                                                                onClientClick.IsNotEmpty() ? "onclick=\"" + onClientClick + "\"" : string.Empty,
                                                                rel.IsNotEmpty() ? "rel=\"" + rel + "\"" : string.Empty,
                                                                text,
                                                                target.IsNotEmpty() ? "target='" + target : string.Empty
                                                                );
            res.Append("</span>");

            return res.ToString();
        }