偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

ASP.NET頁面靜態(tài)化四步走

開發(fā) 后端
本文向您介紹ASP.NET頁面靜態(tài)化的一些思路,通過簡單的四步實現(xiàn)ASP.NET頁面靜態(tài)化。

ASP.NET頁面靜態(tài)化***步:首頁選擇HTML原型網(wǎng)頁

然后再該HTML網(wǎng)頁添加一些自認為特別的標記,已便到時候靜態(tài)化的時候系統(tǒng)能更精確的進行操作!

ASP.NET頁面靜態(tài)化第二步:獲取HTML網(wǎng)頁代碼

我選擇的是通過FileUpload控件進行獲取靜態(tài)度頁面模型,進行保存!

  1. if (FileUpload1.PostedFile.FileName == "")   
  2. {   
  3. Response.Write("");   
  4. return;   
  5. }   
  6. if ((FileUpload1.FileName.LastIndexOf(".") != "htm") ||   
  7. (FileUpload1.FileName.LastIndexOf(".") != "html"))   
  8. {   
  9. Response.Write("");   
  10. return;   
  11. }   
  12. System.Text.Encoding ec = System.Text.Encoding.  
  13. GetEncoding("gb2312");//指定編碼格式   
  14. System.IO.StreamReader sr = new System.IO.StreamReader  
  15. (FileUpload1.PostedFile.FileName, ec);   
  16. string strHTML =Convert.ToString(sr.ReadToEnd());   
  17. strHTML=FormatStr(strHTML); //格式化HTML代碼后,  
  18. 將此strHTML插入數(shù)據(jù)庫 已便使用時候提取!   
  19. sr.Close();   
  20. //貼上格式化HTML方法代碼   
  21. ///    
  22. /// 格式 化 HTML   
  23. ///    
  24. ///    
  25. ///    
  26. private string FormatStr(string str)   
  27. {   
  28. string strContent = str.Replace("<""<");   
  29. strContent = strContent.Replace(">"">");   
  30. //strContent = strContent.Replace(chr(13),"   
  31. ");   
  32. strContent = strContent.Replace(" ", "   
  33. ");   
  34. strContent = strContent.Replace(" "" ");   
  35. strContent = strContent.Replace("[isOK]", "    
  36. strContent = strContent.Replace("[red]""");   
  37. strContent = strContent.Replace("[big]""");   
  38. strContent = strContent.Replace("[/isOK]"">");   
  39. strContent = strContent.Replace("[/b]""");   
  40. strContent = strContent.Replace("[/red]""");   
  41. strContent = strContent.Replace("[/big]""");   
  42. return strContent;   

ASP.NET頁面靜態(tài)化第三步:提取先前保存過的HTML頁面模型

然后通過 string.Replace(char oldstring,char newstring );

對模型頁面中預(yù)先 設(shè)置好的特別標記進行替換成我們需要動態(tài)更改的!

ASP.NET頁面靜態(tài)化第四步:對動態(tài)更新后的HTML代碼進行文件進行保存 平把路徑存如數(shù)據(jù)庫方便調(diào)用!

【編輯推薦】

  1. ASP.NET中的HttpWorkerRequest對像
  2. 介紹ASP.NET MVC框架
  3. 配置ASP.NET AJAX概述
  4. 安裝ASP.NET AJAX的過程
  5. ASP.NET頁面請求原理淺析
    責(zé)任編輯:冰荷 來源: ctocio
    相關(guān)推薦

    2010-04-28 12:02:37

    Forefront網(wǎng)絡(luò)優(yōu)化

    2010-06-13 14:19:40

    學(xué)習(xí)UML

    2013-03-18 11:03:48

    云計算部署云計算CIO

    2009-07-24 10:53:51

    ASP.NET實現(xiàn)靜態(tài)

    2013-06-24 14:42:39

    災(zāi)難恢復(fù)

    2025-04-23 02:00:00

    數(shù)字化轉(zhuǎn)型大數(shù)據(jù)數(shù)字化

    2012-07-26 22:43:27

    2009-07-23 14:17:41

    2009-07-29 17:26:39

    ASP.NET頁面

    2009-10-21 17:13:32

    Oracle用戶名

    2009-07-31 10:23:44

    緩存頁面ASP.NET緩存

    2009-08-03 13:38:18

    ASP.NET編程模型

    2014-02-27 09:27:57

    2010-10-15 15:06:31

    私有云云計算

    2009-08-04 16:09:38

    ASP.NET入門

    2009-07-27 15:25:40

    aspx頁面ASP.NET

    2009-07-31 10:33:54

    ASP.NET頁面輸出

    2009-08-05 18:22:55

    2009-07-23 10:52:38

    2009-07-29 14:35:34

    頁面輸出緩存ASP.NET
    點贊
    收藏

    51CTO技術(shù)棧公眾號