DTcms.Web.UI\Label\article.cs
/// <summary> /// 自定义:分割tags /// </summary> /// <param name="tags"></param> /// <returns></returns> protected string cut_tags(string tags) { string str=string.Empty; tags=tags.Replace(",","|").Replace(",","|"); string[] tag = tags.Split('|'); for(int i=0;i<tag.Length;i++) { str += "<a href=\"/search.html?tags=" + tag[i] + "\">"; str += tag[i]; str += "</a>"; } return str; }
模板页:
<%=cut_tags({dr[tags]}) %>