Html.Span 获得span对应的HTML - HtmlSpanGet

2017-01-30 20:06:46  访问(1411) 赞(0) 踩(0)


        /// <summary>
        /// Html.Span 获得span对应的HTML - HtmlSpanGet 
        /// </summary>
        /// <param name="text"></param>
        /// <param name="title"></param>
        /// <param name="isCursorHand"></param> 
        /// <returns></returns>
        public string HtmlSpanGet
            (
                string text,
                string title,
                bool isCursorHand
            )
        {
            StringBuilder theResult = new StringBuilder();

            theResult.Append("<span ");

            if (title != null && title.Length > 0)
            {
                theResult.Append("title=\"" + StringConvertQuot(title) + "\" ");
            }

            if (isCursorHand)
            {
                theResult.Append("style=\"cursor:pointer;\" ");
            }

            theResult.Append(">");
            
            if (text != null && text.Length > 0)
            {
                theResult.Append(text);
            }
            
            theResult.Append("</span>");

            return theResult.ToString();
        }


标签:Html.Span 获得span对应的HTML - HtmlSpanGet 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)