????? ??????? ?????? ?????? ??????? ?????? ?? ASP.NET ???????? Visual C# .NET

?????? ????????? ?????? ?????????
???? ???????: 308375 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ??? ??????? ????? ??????? ?????? @ OutputCache ?????? ?? ??????? ?????? ?? ASP.NET ?? Visual C# .NET ????? ??????. ????? ??????? ??? ??????? ????? ????? ?????? ????? ????? ?????? ????? ?? ???? ???? ????? ???? ????? ???? ???. ??? ???? ???? ????? ???? ???? ?? ????? ?? ???????. ??? ????? ?? ?? ???? ????? ???????? ???????? ?? ??? ??????? ????? ??????? "?????" ? "???? VaryByParam ? ????? ??? ??????? ??? ???????? ????? ????? ????? ??????? ?? ????? ?????? ???? ????? ????????? ?? ????? OutputCache @.

??????: ??? ??? ???? ?? ??? ??????? ???? ???? ???? ?????? @ OutputCache ??????? ?????? ??? ???? ????????. ?????? ??? ???? ?? ?????????? ???? References ??????.


???????

  • ???? ??????? Microsoft Windows 2000 ?? Windows XP
  • ???? ??? Microsoft .NET
  • ???? ??????? ???????? ?? Microsoft "(IIS)
  • Microsoft ASP.NET

????? ??? @ OutputCache ?????

???????? ??????? @ OutputCache ?????? ?? ??????? ?????? ????? ???? ????? ?????? ????? ??????? ??? ???? ??????. ????? ????? Page.InitOutputCache ??????? ??? ?????? ????? HttpCachePolicy.

????? ??????? @ OutputCache ???? ?????????? ???????:
  • ?????: ???? ??? ????? ???? ????? ?? ????? ??????? ??????. ??? ??? ???? ????? ????????.
  • VaryByParam: ???? ??? ????? ??????? ????? ??????? ?????? ?? ???? ????? ????? ?? ?????. ??? ???? ??????? ??? ?? ????? ????? QueryString ?????? testVal ????? VaryByParam ? ?? ??? ???? ????? ??? ???? ?????? testVal ??? ????? ????? ???? ?? ???? ??????. ???? ???????? ???????? ?????? ???? ???? ????? ' VaryByParam:
    <%@ OutputCache Duration="Seconds" VaryByParam="testVal"%>
    						
    ??????: ????? ????? ???????? ????? (*) ???? ??? ????? ???? ??????? ?????? ?? ?????? ??????. ??? ????? ????? '???' ??? ??? ??? ???? ????? ???? ?? ??????? ??????? ??????.
  • ??????: ???? ??? ????? ??? ???? ?????? ?? ??? ??????? ??????. ????? ????? ??????? ???????:
    • ??
    • ??????
    • ???????? ?????????
    • ??????
    • ???

    ???? ???????? ???????? ?????? ???? ???? ??? ??????:
    <%@ OutputCache Duration="Seconds" Location="Client" %>
    					
  • VaryByCustom: ????? ??? ????? ??? ???????? ? ??? ???? ????? ???? ???? ??????? ?????? ??? ????? ???????? ????? ??? ??????? ?????????. ??? ???? ??????? ??? Microsoft Internet Explorer 5 ???? Internet Explorer 5.5 ??????. ??? ????? VaryByCustom ??? ???????? ????? ????? ????? ??????? ???? ??? ????? ????????. ?? ???? ????? ????? ?????? ?? ??????? ?????? ??????????? ????? ????. ??? ??? ??????? ?? ???? ??? ??? ???? ??? ?????? ??????? HttpApplication.GetVaryByCustomString ?? ??? Global.asax.

    ???? ???????? ???????? ?????? ???? ???? ????? VaryByCustom:
    <%@ OutputCache Duration="Seconds" VaryByCustom="string" %>
    					
  • VaryByHeader: ????? ??? ???? ?? ?????? ???? ??? HTTP ????? ??????? ?????? ??????? ????? ??????? ??????? ?????. ???? ???????? ???????? ?????? ???? ???? ????? VaryByHeader:
    <%@ OutputCache Duration="60" VaryByHeader="Accept-Language" %>
    					

??????? ??????? ?????? ????? ????? OutputCache @

???? ??????? ??????? ????? ??????? ??? ????? ??????? ???? ??????? ?????? ?????? ????? ???? ???????? ???? ????? ??????? ??????.
  1. ????? ????? Visual Basic ????? ASP.NET ??? ??? ???? ??? ???:
    1. ???? Visual Studio .NET.
    2. ?? ??????? ???? ??? ??? ???? ?? ???? ??? ???????.
    3. ?? ???? ?????? ????? ???? ? ???? ??? Visual C# ?????? ??? ????? Project ?? ???? ??? ????? ??? ASP.NET ??? ?????. ?? ???? ???? ??? ???? OutputCacheDemo ??? ?? ???? ??? ?????.
  2. ????? ???? .aspx ????? ?? Visual Studio .NET ??? ???:
    1. ?? "?????? ??????" ???? ??? ?????? ?????? ??? ???? ??????? ???? ??? ????? ?? ?? ???? ??? ????? ????? ???.
    2. ?? ???? ???? ??? ???? OutputCacheDuration.aspx ??? ?? ???? ??? ???.
  3. ??? ??? ????????? ???? ???? Visual Studio .NET ??? ??????.
  4. ????? ???????? ???????? ??????? ???? ??? ?????? ?????? ??? ????? ??? ?? ???? ??? ???. ?? Visual Studio .NET ? ???? ??? ??? ?? HTML ??? ??????? "?????" ???? ??? ????????? ???????? ?? ???? .aspx:
    <%@ OutputCache Duration="20" VaryByParam="none"%>
    <HTML>
       <HEAD>
       <script language="C#" runat="server">
       void Page_Load(object sender, EventArgs e) 
       {	
          Label1.Text = "Time: " + DateTime.Now.TimeOfDay.ToString();
       }
       </script>
       </HEAD>
       <body>
          <STRONG>@ OutputCache Duration Sample</STRONG>
          <hr>
          <br>
          <asp:Label id="Label1" runat="server">Label</asp:Label>
          <br>
       </body>
    </HTML>
    					
  5. ?? ??????? ???? ???? ??? ??? OutputCacheDuration.aspx ???? ??????.
  6. ?? ??????? ???? ?? ???? ??????? ????????? (IDE) ? ???? ??? ?????.
  7. ?????? "???????" ? ???? ??? ?????? ?????? ??? OutputCacheDuration.aspx ?? "?????? ??????" ??? ?? ???? ??? ??? ?? ??????.
  8. ??? ???? ?????? ?? ???????? ?????? ?????? ????? ???? ???? ?? ???????.
  9. ????? ?????? ?? ????????. ???? ?? ????? ?? ??? ??? ??? ??? ??????. ?? ???? ????? ?????? ??? ?????? ??????? ??? ??????? 20 ??? ??? ????? ?????? ??????? ?????? ??????.

    ??????: ??? ??? ???? ???? ?????? ?? ?????? ?????? ????? ??? ????? F5 ?????? ??????. ??? ??? ???? ???? ?????? ?? ?????? ????? IDE .NET Visual Studio ???? ???? ??? ?????? ?????? ??? ?????? ?? ???? ??? "?????" ??? ????? ??????.

??????? ??????? ?????? ????? OutputCache VaryByParam @

???? ??????? ??????? ????? ??????? ??? VaryByParam ??????? ???? ??????? ?????? ?????? ???????? ?????? ??????? ?????? ?? ???? ?????? ???????? ??? ???? ??? ??? ????????? QueryString ????? ??.
  1. ????? ???? .aspx ????? ?? Visual Studio .NET ??? ???:
    1. ?? "?????? ??????" ???? ??? ?????? ?????? ??? ???? ??????? ???? ??? ????? ?? ?? ???? ??? ????? ????? ???.
    2. ?? ???? ???? ??? ???? OutputCacheVaryByParam.aspx ??? ?? ???? ??? ???.
  2. ??? ????????? ???????? ?????????? ???? Visual Studio .NET ???????? ??? ?????? ???? ???????.
  3. ????? ???????? ???????? ??????? ???? ??? ?????? ?????? ??? ????? ??? ?? ???? ??? ???. ?? Visual Studio .NET ? ???? ??? ??? ?? HTML ??? ??????? "?????" ???? ??? ????????? ???????? ?? ???? .aspx:
    <%@ OutputCache Duration="20" VaryByParam="testVal"%>
    <HTML>
       <HEAD>
          <script language="C#" runat="server">
       void Page_Load(object sender, EventArgs e) 
       {	
          Label1.Text = "Time: " + DateTime.Now.TimeOfDay.ToString();
       }
       </script>
       </HEAD>
       <body>
          <P>
             <STRONG>@ OutputCache VaryByParam Sample</STRONG>
          </P>
          <P>
             <hr>
          </P>
          <P>
             <br>
             <asp:Label id="Label1" runat="server"></asp:Label>
             <br>
             <hr>
             <a href=http://yourservername/OutputCacheDemo/OutputCacheVaryByParam.aspx?testVal=123">testVal(123)</a>
             <br>
             <a href=http://yourservername/OutputCacheDemo/OutputCacheVaryByParam.aspx?testVal=345">testVal(345)</a>
          </P>
       </body>
    </HTML>
    						
    ??????: ??? ?? ???? ?????? ???????? ??????? ?? ????????? ???????? ?????? ???? ??? ???? ???. ???????? ??? ???? ?? ????? ?? ????? ' VaryByParam ?? ?????? ????? ???????? ??? ???? ????? QueryStringtestVal. ???? ??? ?????? ??????? ??? ??????? ?????? ??? ???? ??? ???? ????? QueryStringtestVal ?? ????.
  4. ?? ??????? ???? ???? ??? ??? OutputCacheVaryByParam.aspx ???? ??????.
  5. ?? ??????? ???? ?? IDE ???? ??? ?????.
  6. ?????? "???????" ? ???? ??? ?????? ?????? ??? OutputCacheVaryByParam.aspx ?? "?????? ??????" ??? ?? ???? ??? ??? ?? ??????.
  7. ??? ???? ?????? ?? ???????? ? ???? ??? testVal(123). ???? ??? ???????? ??????? ?????? ??? ?????? ???? ?? QueryString ????? ????? testVal ??? "123". ???? ?????? ????? ???? ????.
  8. ???? ??? testVal(123) ??? ????. ???? ?? ????? ?? ??? ??? ??? ??? ??????. ??? ?? ??????? ?????? ????? ?????? ???????? ??? ???? ????? testVal.
  9. ???? ??? testVal(345). ???? ???? ??? ???? ??? ??????.
  10. ???? ??? testVal(345) ??? ????. ???? ??????? ?????? ????? ?????? ??????? ???? ????? ?? ????????.
  11. ???? ??? testVal(123) ?????? ??? ?????? ?????. ???? ????????? ????? ??????? ?????? ????? ???? ?????? ???? ? ???????? ??? ???? ????? QueryString ???? ?? ???????.

??????? ??????? ????????

  • ??? ??????? VaryByParam ?? ??? ??? ??????? ????? QueryString ??????? ????? ?? ??????? ????? ??????? ?????? ??????.
  • ?? ?? ???????? ????? ????? ????????.
  • ??? ??????? VaryByCustom ?????? ????? HttpApplication.GetVaryByCustomString ?? ??? Global.asax ??? ??????? ??????? ????????? ???????? ??? ?? ?????? ??? ?? ????? ?? ??????? ??????? ???? ??? ??????? ?? ?????.

?????

?????? ??? ???? ?? ????????? ??? ??????? ?????? ????? ?????? ???? ??? ????? Microsoft ??????? ??? ?????:
???? GotDotNet ????? ???????? ???????? QuickStart ??????? ??????
????? ????? ????? ???? ??? Microsoft .NET (SDK)
http://msdn2.microsoft.com/en-us/library/ms950382.aspx

??????? ?????? ????? ASP.NET
http://msdn2.microsoft.com/en-us/library/xsbfdd8c(vs.71).aspx

@ OutputCache
http://msdn2.microsoft.com/en-us/library/hdxfb6cy(vs.71).aspx

???????

???? ???????: 308375 - ????? ??? ??????: 14/????? ??????/1428 - ??????: 7.9
????? ???
  • Microsoft ASP.NET 1.1
  • Microsoft ASP.NET 1.0
  • Microsoft Visual C# .NET 2003 Standard Edition
  • Microsoft Visual C# .NET 2002 Standard Edition
????? ??????: 
kbmt kbcaching kbhowtomaster kbio KB308375 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????308375

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com