日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
ASP.NET頁面優(yōu)化:性能提升8倍的方法

閱讀目錄

創(chuàng)新互聯(lián)公司服務(wù)項(xiàng)目包括崇陽網(wǎng)站建設(shè)、崇陽網(wǎng)站制作、崇陽網(wǎng)頁制作以及崇陽網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢(shì)、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,崇陽網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到崇陽省份的部分城市,未來相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!


  1. 開始
  2. 測(cè)試背景
  3. 測(cè)試方法
  4. 測(cè)試用例1:WebFromPage.aspx
  5. 測(cè)試用例2:InlinePage.aspx
  6. 分析優(yōu)化結(jié)果1
  7. 測(cè)試用例3:InlineUserControl.ascx
  8. 分析優(yōu)化結(jié)果2

今天與大家分享:一種優(yōu)化頁面執(zhí)行速度的方法。

采用這個(gè)方法,可以使用頁面的執(zhí)行速度獲得【8倍】的提升效果。

為了讓您對(duì)優(yōu)化的效果有個(gè)直觀的了解,我準(zhǔn)備了下面的測(cè)試結(jié)果截圖:

測(cè)試環(huán)境:

  1. Windows Server 2003 SP2
  2. Viaual Studio 2008,使用自帶的WebDev.WebServer.EXE運(yùn)行網(wǎng)站程序。
  3. (ThinkPad SL510):Core2 T6670 2.2GHz, 4G內(nèi)存

二個(gè)紅框中的數(shù)字反映了優(yōu)化前后的執(zhí)行時(shí)間。

數(shù)字表明:優(yōu)化前后,執(zhí)行時(shí)間有了8倍多的差別。

本文的測(cè)試結(jié)果也僅僅只是一個(gè)參考數(shù)字,這個(gè)結(jié)果也只是根據(jù)我所設(shè)計(jì)的測(cè)試頁面得出的。

優(yōu)化的過程中,如果不使用服務(wù)器控件,那么給GC減少的壓力其實(shí)也是無法測(cè)試到的。

在測(cè)試過程中,我還發(fā)現(xiàn)測(cè)試結(jié)果并不是很穩(wěn)定,因此截圖具有一定的偶然性。

測(cè)試頁面或許在某些方面存在一些片面性,因此,結(jié)果僅供參考。

測(cè)試背景

看過了優(yōu)化結(jié)果,再來介紹一下:這個(gè)測(cè)試到底是在測(cè)試什么東西?

現(xiàn)在有很多做ASP.NET的開發(fā)人員,應(yīng)該都是從ASP.NET的WebForm編程模型開始學(xué)習(xí)的。大家都很喜歡用服務(wù)器控件,不管輸出什么,都會(huì)使用服務(wù)器控件。有時(shí)候?yàn)榱俗岉撁娉尸F(xiàn)干凈的HTML代碼,有些人會(huì)選擇使用Repeater,Literal這類簡(jiǎn)單的服務(wù)器控件。或許有些人認(rèn)為:我已不使用GridView這樣強(qiáng)大復(fù)雜的控件,頁面執(zhí)行速度已經(jīng)很快了。

真是這樣嗎?

今天測(cè)試的起點(diǎn)就從使用簡(jiǎn)單的服務(wù)器開始,我會(huì)分二次對(duì)它做一系列的性能優(yōu)化。

最終就是上圖中的3個(gè)結(jié)果,它們反映了二次優(yōu)化的改進(jìn)過程。

在繼續(xù)介紹之前,有一點(diǎn)我想有必要說明一下:

優(yōu)化的過程涉及到ASP.NET服務(wù)器控件的使用,測(cè)試結(jié)果也僅僅只是一個(gè)參考數(shù)字。

如果您認(rèn)為您的開發(fā)工作非常依賴于服務(wù)器控件的使用,

那么測(cè)試結(jié)果對(duì)您來說其實(shí)是無意義的,請(qǐng)不要在意這個(gè)結(jié)果。

測(cè)試方法

在這次優(yōu)化過程中,我并沒有設(shè)計(jì)很復(fù)雜的測(cè)試頁面,而是一個(gè)很簡(jiǎn)單的測(cè)試頁面,頁面顯示效果如下:

這個(gè)頁面其實(shí)就是顯示了一堆超鏈接,它們來自于我的博客側(cè)邊欄的【推薦排行榜】,總共有20條記錄,我讓頁面重復(fù)5次輸出,也就是生成了100個(gè)超鏈接。

測(cè)試的數(shù)據(jù)是這樣獲取的:

我復(fù)制了我的博客側(cè)邊欄的【推薦排行榜】的那段HTML代碼,保存到一個(gè)文件中:

然后,網(wǎng)站在初始化時(shí),從這段HTML代碼提取鏈接地址以及顯示文字,保存到一個(gè)BlogInfo的列表中,代碼如下:

 
 
 
 
  1. public class BlogInfo  
  2. {  
  3.     public string Title;  
  4.     public string Href;  
  5. }  
  6.  
  7. public static class XmlDb  
  8. {  
  9.     public static List Blogs { get; private set; }  
  10.  
  11.  
  12.     public static void LoadBlogs()  
  13.     {  
  14.         string filePath = Path.Combine(HttpRuntime.AppDomainAppPath, @"App_Data\RecommendList.html");  
  15.  
  16.         XElement html = XElement.Parse(System.IO.File.ReadAllText(filePath));  
  17.  
  18.         Blogs =  
  19.             (from a in html.Elements("li").Elements("a")  
  20.              select new BlogInfo { Title = a.Value, Href = a.Attribute("href").Value }).ToList();  
  21.     }  

測(cè)試時(shí),就把XmlDb.Blogs的內(nèi)容顯示在網(wǎng)頁中。
我想這個(gè)測(cè)試還是比較接近于現(xiàn)實(shí)開發(fā)的。

這里又有一個(gè)問題:我如何測(cè)試頁面的執(zhí)行速度?

雖然說創(chuàng)建HttpWebRequest訪問頁面是個(gè)很簡(jiǎn)單的方法,但我并不打算這樣做。
因?yàn)閺腍ttpWebRequest發(fā)起調(diào)用到獲取結(jié)果,這其中除了有頁面的執(zhí)行時(shí)間,還混雜較多的額外調(diào)用開銷。最終,我選擇了在一次HTTP請(qǐng)求中,循環(huán)調(diào)用Server.Execute來執(zhí)行頁面,并統(tǒng)計(jì)時(shí)間的方式。其實(shí)如何選擇測(cè)試方法,對(duì)于二個(gè)測(cè)試對(duì)象還說,都是公平的。只是說:盡量減少一些額外的調(diào)用開銷,會(huì)讓測(cè)試結(jié)果的差異更大,也更明顯。

說明:為了測(cè)試代碼寫起來簡(jiǎn)單,我使用了MyMVC框架。

測(cè)試用例1:WebFromPage.aspx

前面介紹了測(cè)試背景以及測(cè)試方法。現(xiàn)在就來介紹第1個(gè)測(cè)試用例,它采用了WebForm編程模型中最經(jīng)典的寫法。

頁面代碼:

 
 
 
 
  1. <%@ Page Language="C#" CodeFile="WebFromPage.aspx.cs" Inherits="TestPage_WebFromPage" %> 
  2.  
  3.  
  4.  
  5.     PagePerformanceTest   http://www.cnblogs.com/fish-li/ 
  6.  
  7.  
  8.  
  9. This is WebFromPage.aspx

     
  10.  
  11.  
  12.  
  13.      
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.      
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.      
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.      
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.      
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  

頁面的CodeFile代碼:

 
 
 
 
  1. public partial class TestPage_WebFromPage : System.Web.UI.Page  
  2. {  
  3.     protected override void OnLoad(EventArgs e)  
  4.     {  
  5.         base.OnLoad(e);  
  6.  
  7.         repeater1.DataSource = XmlDb.Blogs;  
  8.         repeater1.DataBind();  
  9.         repeater2.DataSource = XmlDb.Blogs;  
  10.         repeater2.DataBind();  
  11.         repeater3.DataSource = XmlDb.Blogs;  
  12.         repeater3.DataBind();  
  13.         repeater4.DataSource = XmlDb.Blogs;  
  14.         repeater4.DataBind();  
  15.         repeater5.DataSource = XmlDb.Blogs;  
  16.         repeater5.DataBind();  
  17.     }  
  18.  
  19.     protected void repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)  
  20.     {  
  21.         if( e.Item.ItemType == ListItemType.Item ) {  
  22.             BlogInfo blog = e.Item.DataItem as BlogInfo;  
  23.             HyperLink link1 = e.Item.FindControl("link1") as HyperLink;  
  24.             link1.NavigateUrl = blog.Href;  
  25.             link1.Text = blog.Title;  
  26.         }  
  27.     }  

測(cè)試代碼:

 
 
 
 
  1. [Action]  
  2. public object Test1(string callTimes)  
  3. {  
  4.     int count = 0;  
  5.     int.TryParse(callTimes, out count);  
  6.     if( count <= 0 )  
  7.         return count;  
  8.  
  9.     HttpContext context = HttpContext.Current;  
  10.       
  11.     // 先執(zhí)行一次,排除編譯時(shí)間  
  12.     string html = MyMVC.PageExecutor.Render(context, "/TestPage/WebFromPage.aspx", null);  
  13.  
  14.     Stopwatch watch = Stopwatch.StartNew();  
  15.     for( int i = 0; i < count; i++ )  
  16.         html = MyMVC.PageExecutor.Render(context, "/TestPage/WebFromPage.aspx", null);  
  17.     watch.Stop();  
  18.  
  19.     return watch.Elapsed.ToString();  

當(dāng)我測(cè)試執(zhí)行10000次時(shí),耗時(shí):00:00:07.5607229

測(cè)試用例2:InlinePage.aspx

與測(cè)試用例1不同,測(cè)試用例2則完全不使用服務(wù)器控件。

頁面代碼:

 
 
 
 
  1. <%@ Page Language="C#" %> 
  2.  
  3.  
  4.  
  5.     PagePerformanceTest   http://www.cnblogs.com/fish-li/ 
  6.  
  7.  
  8.  
  9. This is InlinePage.aspx

     
  10.  
  11. <% foreach( BlogInfo b in XmlDb.Blogs ) { %> 
  12.     " target="_blank"><%= b.Title %> 
  13. <% } %> 
  14.  
  15.  
  16. <% foreach( BlogInfo b in XmlDb.Blogs ) { %> 
  17.     " target="_blank"><%= b.Title %> 
  18. <% } %> 
  19.  
  20.  
  21. <% foreach( BlogInfo b in XmlDb.Blogs ) { %> 
  22.     " target="_blank"><%= b.Title %> 
  23. <% } %> 
  24.  
  25.  
  26. <% foreach( BlogInfo b in XmlDb.Blogs ) { %> 
  27.     " target="_blank"><%= b.Title %> 
  28. <% } %> 
  29.  
  30.  
  31. <% foreach( BlogInfo b in XmlDb.Blogs ) { %> 
  32.     " target="_blank"><%= b.Title %> 
  33. <% } %> 
  34.  
  35.  
  36.  
  37.  

測(cè)試代碼:

 
 
 
 
  1. [Action]  
  2. public object Test2(string callTimes)  
  3. {  
  4.     int count = 0;  
  5.     int.TryParse(callTimes, out count);  
  6.     if( count <= 0 )  
  7.         return count;  
  8.  
  9.     HttpContext context = HttpContext.Current;  
  10.  
  11.     // 先執(zhí)行一次,排除編譯時(shí)間  
  12.     string html = MyMVC.PageExecutor.Render(context, "/TestPage/InlinePage.aspx", null);  
  13.  
  14.     Stopwatch watch = Stopwatch.StartNew();  
  15.     for( int i = 0; i < count; i++ )  
  16.         html = MyMVC.PageExecutor.Render(context, "/TestPage/InlinePage.aspx", null);  
  17.     watch.Stop();  
  18.  
  19.     return watch.Elapsed.ToString();  

當(dāng)我測(cè)試執(zhí)行10000次時(shí),耗時(shí):00:00:01.2345842

分析優(yōu)化結(jié)果1

測(cè)試用例1執(zhí)行相同次數(shù)所花費(fèi)的時(shí)間是測(cè)試用例2的6倍,為什么會(huì)這樣呢?

為了回答這個(gè)問題,我們首先要知道前面二個(gè)頁面在執(zhí)行時(shí),它們是如何運(yùn)行的。

說到這里,就不得不談ASP.NET的頁面編譯方式了。

ASP.NET的頁面編譯過程是個(gè)復(fù)雜的操作,其實(shí)我們可以不用關(guān)心頁面是如何編譯的,但要知道:頁面編譯后是什么樣的。

為了能直觀地了解頁面編譯后的樣子,我編譯了整個(gè)網(wǎng)站,并生成到一個(gè)DLL文件中,然后使用Reflector.exe來分析這個(gè)DLL的源代碼。

將網(wǎng)站編譯成一個(gè)DLL文件有二個(gè)方法:

  1. 安裝WebDeployment插件。
  2. 使用我的工具:FishAspnetTool

本文將使用FishAspnetTool來編譯測(cè)試網(wǎng)站獲得編譯后的DLL文件。

FishAspnetTool是什么?

FishAspnetTool是我在使用Visual Web Developer 2005時(shí),為了方便編譯網(wǎng)站而寫的一個(gè)小工具。

下載地址:http://www.cnblogs.com/fish-li/archive/2011/10/30/2229497.html

注意:下載的是一個(gè)工具包,安裝后,從開始菜單中運(yùn)行FishTools\FishAspnetTool即可。

下面是工具的運(yùn)行截圖。

操作方法:

1. 點(diǎn)擊粉色按鈕,選擇網(wǎng)站路徑。

2. 單選按鈕選擇第2項(xiàng)。

3. 點(diǎn)擊【發(fā)布網(wǎng)站】按鈕。

在編譯網(wǎng)站之后,我就可以知道網(wǎng)站在運(yùn)行時(shí)如何運(yùn)行頁面了。

測(cè)試用例1的頁面,最后被編譯成這樣了:

 
 
 
 
  1. namespace ASP  
  2. {  
  3.     using System;  
  4.     using System.Diagnostics;  
  5.     using System.Runtime.CompilerServices;  
  6.     using System.Web;  
  7.     using System.Web.UI;  
  8.     using System.Web.UI.WebControls;  
  9.  
  10.     [CompilerGlobalScope]  
  11.     public class testpage_webfrompage_aspx : TestPage_WebFromPage, IHttpHandler  
  12.     {  
  13.         private static object __fileDependencies;  
  14.         private static bool __initialized;  
  15.  
  16.         [DebuggerNonUserCode]  
  17.         public testpage_webfrompage_aspx()  
  18.         {  
  19.             base.AppRelativeVirtualPath = "~/TestPage/WebFromPage.aspx";  
  20.             if (!__initialized)  
  21.             {  
  22.                 string[] virtualFileDependencies = new string[] { "~/TestPage/WebFromPage.aspx", "~/TestPage/WebFromPage.aspx.cs" };  
  23.                 __fileDependencies = base.GetWrappedFileDependencies(virtualFileDependencies);  
  24.                 __initialized = true;  
  25.             }  
  26.             base.Server.ScriptTimeout = 0x1c9c380;  
  27.         }  
  28.  
  29.         [DebuggerNonUserCode]  
  30.         private void __BuildControl__control10(Control __ctrl)  
  31.         {  
  32.             IParserAccessor accessor = __ctrl;  
  33.             accessor.AddParsedSubObject(new LiteralControl(""));  
  34.         }  
  35.  
  36.         [DebuggerNonUserCode]  
  37.         private void __BuildControl__control11(Control __ctrl)  
  38.         {  
  39.             IParserAccessor accessor = __ctrl;  
  40.             accessor.AddParsedSubObject(new LiteralControl("\r\n\t"));  
  41.             HyperLink link = this.__BuildControl__control12();  
  42.             accessor.AddParsedSubObject(link);  
  43.             accessor.AddParsedSubObject(new LiteralControl("\r\n"));  
  44.         }  
  45.  
  46.         [DebuggerNonUserCode]  
  47.         private HyperLink __BuildControl__control12()  
  48.         {  
  49.             HyperLink link = new HyperLink {  
  50.                 TemplateControl = this 
  51.             };  
  52.             link.ApplyStyleSheetSkin(this);  
  53.             link.ID = "link1";  
  54.             return link;  
  55.         }  
  56.  
  57.         [DebuggerNonUserCode]  
  58.         private void __BuildControl__control13(Control __ctrl)  
  59.         {  
  60.             IParserAccessor accessor = __ctrl;  
  61.             accessor.AddParsedSubObject(new LiteralControl(""));  
  62.         }  
  63.  
  64.         [DebuggerNonUserCode]  
  65.         private void __BuildControl__control14(Control __ctrl)  
  66.         {  
  67.             IParserAccessor accessor = __ctrl;  
  68.             accessor.AddParsedSubObject(new LiteralControl("\r\n\t"));  
  69.             HyperLink link = this.__BuildControl__control15();  
  70.             accessor.AddParsedSubObject(link);  
  71.             accessor.AddParsedSubObject(new LiteralControl("\r\n"));  
  72.         }  
  73.  
  74.         [DebuggerNonUserCode]  
  75.         private HyperLink __BuildControl__control15()  
  76.         {  
  77.             HyperLink link = new HyperLink {  
  78.                 TemplateControl = this 
  79.             };  
  80.             link.ApplyStyleSheetSkin(this);  
  81.             link.ID = "link1";  
  82.             return link;  
  83.         }  
  84.  
  85.         [DebuggerNonUserCode]  
  86.         private void __BuildControl__control16(Control __ctrl)  
  87.         {  
  88.             IParserAccessor accessor = __ctrl;  
  89.             accessor.AddParsedSubObject(new LiteralControl(""));  
  90.         }  
  91.  
  92.         [DebuggerNonUserCode]  
  93.         private void __BuildControl__control2(Control __ctrl)  
  94.         {  
  95.             IParserAccessor accessor = __ctrl;  
  96.             accessor.AddParsedSubObject(new LiteralControl("\r\n\t"));  
  97.             HyperLink link = this.__BuildControl__control3();  
  98.             accessor.AddParsedSubObject(link);  
  99.             accessor.AddParsedSubObject(new LiteralControl("\r\n"));  
  100.         }  
  101.  
  102.         [DebuggerNonUserCode]  
  103.         private HyperLink __BuildControl__control3()  
  104.         {  
  105.             HyperLink link = new HyperLink {  
  106.                 TemplateControl = this 
  107.             };  
  108.             link.ApplyStyleSheetSkin(this);  
  109.             link.ID = "link1";  
  110.             return link;  
  111.         }  
  112.  
  113.         [DebuggerNonUserCode]  
  114.         private void __BuildControl__control4(Control __ctrl)  
  115.         {  
  116.             IParserAccessor accessor = __ctrl;  
  117.             accessor.AddParsedSubObject(new LiteralControl(""));  
  118.         }  
  119.  
  120.         [DebuggerNonUserCode]  
  121.         private void __BuildControl__control5(Control __ctrl)  
  122.         {  
  123.             IParserAccessor accessor = __ctrl;  
  124.             accessor.AddParsedSubObject(new LiteralControl("\r\n\t"));  
  125.             HyperLink link = this.__BuildControl__control6();  
  126.             accessor.AddParsedSubObject(link);  
  127.             accessor.AddParsedSubObject(new LiteralControl("\r\n"));  
  128.         }  
  129.  
  130.         [DebuggerNonUserCode]  
  131.         private HyperLink __BuildControl__control6()  
  132.         {  
  133.             HyperLink link = new HyperLink {  
  134.                 TemplateControl = this 
  135.             };  
  136.             link.ApplyStyleSheetSkin(this);  
  137.             link.ID = "link1";  
  138.             return link;  
  139.         }  
  140.  
  141.         [DebuggerNonUserCode]  
  142.         private void __BuildControl__control7(Control __ctrl)  
  143.         {  
  144.             IParserAccessor accessor = __ctrl;  
  145.             accessor.AddParsedSubObject(new LiteralControl(""));  
  146.         }  
  147.  
  148.         [DebuggerNonUserCode]  
  149.         private void __BuildControl__control8(Control __ctrl)  
  150.         {  
  151.             IParserAccessor accessor = __ctrl;  
  152.             accessor.AddParsedSubObject(new LiteralControl("\r\n\t"));  
  153.             HyperLink link = this.__BuildControl__control9();  
  154.             accessor.AddParsedSubObject(link);  
  155.             accessor.AddParsedSubObject(new LiteralControl("\r\n"));  
  156.         }  
  157.  
  158.         [DebuggerNonUserCode]  
  159.         private HyperLink __BuildControl__control9()  
  160.         {  
  161.             HyperLink link = new HyperLink {  
  162.                 TemplateControl = this 
  163.             };  
  164.             link.ApplyStyleSheetSkin(this);  
  165.             link.ID = "link1";  
  166.             return link;  
  167.         }  
  168.  
  169.         [DebuggerNonUserCode]  
  170.         private Repeater __BuildControlrepeater1()  
  171.         {  
  172.             Repeater repeater = new Repeater();  
  173.             base.repeater1 = repeater;  
  174.             repeater.ItemTemplate = new CompiledTemplateBuilder(new BuildTemplateMethod(this.__BuildControl__control2));  
  175.             repeater.FooterTemplate = new CompiledTemplateBuilder(new BuildTemplateMethod(this.__BuildControl__control4));  
  176.             repeater.ID = "repeater1";  
  177.             repeater.ItemDataBound += new RepeaterItemEventHandler(this.repeater1_ItemDataBound);  
  178.             return repeater;  
  179.         }  
  180.  
  181.         [DebuggerNonUserCode]  
  182.         private Repeater __BuildControlrepeater2()  
  183.         {  
  184.             Repeater repeater = new Repeater();  
  185.             base.repeater2 = repeater;  
  186.             repeater.ItemTemplate = new CompiledTemplateBuilder(new BuildTemplateMethod(this.__BuildControl__control5));  
  187.             repeater.FooterTemplate = new CompiledTemplateBuilder(new BuildTemplateMethod(this.__BuildControl__control7));  
  188.             repeater.ID = "repeater2";  
  189.             repeater.ItemDataBound += new RepeaterItemEventHandler(this.repeater1_ItemDataBound);  
  190.             return repeater;  
  191.         }  
  192.  
  193.         [DebuggerNonUserCode]  
  194.         private Repeater __BuildControlrepeater3()  
  195.         {  
  196.             Repeater repeater = new Repeater();  
  197.             base.repeater3 = repeater;  
  198.             repeater.ItemTemplate = new CompiledTemplateBuilder(new BuildTemplateMethod(this.__BuildControl__control8));  
  199.             repeater.FooterTemplate = new CompiledTemplateBuilder(new BuildTemplateMethod(this.__BuildControl__control10));  
  200.             repeater.ID = "repeater3";  
  201.             repeater.ItemDataBound += new RepeaterItemEventHandler(this.repeater1_ItemDataBound);  
  202.             return repeater;  
  203.         }  
  204.  
  205.         [DebuggerNonUserCode]  
  206.         private Repeater __BuildControlrepeater4()  
  207.         {  
  208.             Repeater repeater = new Repeater();  
  209.             base.repeater4 = repeater;  
  210.             repeater.ItemTemplate = new CompiledTemplateBuilder(new BuildTemplateMethod(this.__BuildControl__control11));  
  211.             repeater.FooterTemplate = new CompiledTemplateBuilder(new BuildTemplateMethod(this.__BuildControl__control13));  
  212.             repeater.ID = "repeater4";  
  213.             repeater.ItemDataBound += new RepeaterItemEventHandler(this.repeater1_ItemDataBound);  
  214.             return repeater;  
  215.         }  
  216.  
  217.         [DebuggerNonUserCode]  
  218.         private Repeater __BuildControlrepeater5()  
  219.         {  
  220.             Repeater repeater = new Repeater();  
  221.             base.repeater5 = repeater;  
  222.             repeater.ItemTemplate = new CompiledTemplateBuilder(new BuildTemplateMethod(this.__BuildControl__control14));  
  223.             repeater.FooterTemplate = new CompiledTemplateBuilder(new BuildTemplateMethod(this.__BuildControl__control16));  
  224.             repeater.ID = "repeater5";  
  225.             repeater.ItemDataBound += new RepeaterItemEventHandler(this.repeater1_ItemDataBound);  
  226.  
    文章題目:ASP.NET頁面優(yōu)化:性能提升8倍的方法
    地址分享:http://www.5511xx.com/article/coijeep.html