打印AHref的Html效果 - HtmlAHrefPrint
2017-05-20 10:42:51 访问(1577) 赞(0) 踩(0)
/// <summary>
/// 打印AHref的Html效果
/// </summary>
/// <param name="url"></param>
/// <param name="strText"></param>
/// <param name="strTitle"></param>
/// <param name="cssClass"></param>
/// <returns></returns>
public string HtmlAHrefPrint(string url,string strText,string strTitle,string cssClass)
{
StringBuilder theResult = new StringBuilder();
theResult.Append("<a ");
if (url != null && url.Length > 0)
{
theResult.Append(" href=\"" + url.Replace("\"", """) + "\"");
}
if (strTitle != null && strTitle.Length > 0)
{
theResult.Append(" title=\"" + strTitle.Replace("\"", """) + "\"");
}
if(cssClass!=null&&cssClass.Length > 0)
{
theResult.Append(" class=\"" + cssClass.Replace("\"", """) + "\"");
}
theResult.Append(">" + strText + "</a>");
return theResult.ToString();
}
标签:
打印AHref的Html效果 - HtmlAHrefPrint 


上一条:
下一条:
相关评论
发表评论