asp.net的一些實用小方法

  1. /// <summary>
  2. /// 過濾HTML標記
  3. /// </summary>
  4. /// <param name="str"></param>
  5. /// <returns></returns>
  6. public static string GetFilterHTML(string str)
  7. {
  8.        string rStr = "";
  9.        if (!string.IsNullOrEmpty(str))
  10.        {
  11.             rStr = Regex.Replace(str, "<[^>]*>""", RegexOptions.IgnoreCase);
  12.             rStr = rStr.Replace("&nbsp;""");
  13.        }
  14.        return rStr;
  15. }
  1. <!-- 設置頁面緩存時間 180000秒=5小時 -->
  2. <%@ OutputCache Duration="180000" VaryByParam="none" %>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章