???? ID: 308378 - ????? ???????: 17 ?? 2012 - ??????: 3.0
??? ??? ASP ?????? ???? ?? ??? ?????Visual C# ?? ????? ?? ???????
?????? ?????? This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
?? ???? ??? ASP ??? ?????? ?? ??????????? ???? ?? ??? ???? ????????? ???? ?? ??????? ??? ?????? ?????? ??? ?? ??? ??????? ?? ??? ??????????? ???? ??? ????; ??? ?????? ?? ??? ??????? ??? ???-??? ?????????? ???????? (.ascx) ?? ?????? ?? ??????? ??? ???????? ?????????? ???????? ?? ???? ??? ???????? ??? ???????, ?? ??????? ?? ??? ?????? ???? ???? ?? ??? ?????? ??????? ??? ?? ???? ??? ?? ????? ??? ?? ??????????? ??????? ???? ?? ??? ???? ?????? ???
?? ?? ???? ??? ????? ?? ????? ?? ??? ??? ?????? ?????? ??? ???????? ?????, ????? ??? ?? ??? ??? ??? ?????? ?? ??? ????? ????????? ????
??????????Microsoft Windows 2000 Microsoft ??????? ??????????? ????? (IIS) Microsoft.??? ????? ASP.??? ?? ASP ????????? ??? ????????? ?? ????? C#.??????? ?? ASP ????? ?? ??? ????? ????? ?? ???????? ???? ??????? ??? ????????? ?? ??? FragmentCache.
Microsoft Visual Studio ????????? ????? ???? ??, ??? ?? ????? ????, ?? ?? ????????? ?? ????? ???????? ????????? ????? ????? ???, Visual c# ????????? , ????????? ?????? ?? ??? ????? ????, ?? ???? ??? ASP ????? ???????? ??? ????????? ???????? ?? ??????? ????? ???, ???? ???? FragmentCache . ????? ????? ???, ???? ????? ?? ??? ????? ??? ?? ??????? ????? ?? ????? ?? ??? ???, ?? ???? ????? ?? ??? http://localhost ?? ??? ??? ???? ???? ???? ?????????? ???????? ??????? ?????? ???? ?? ???? ??? ?? ????? ????? ?? ?????????? ???????? ?? ???????? ?? ????? ??? ?????? ???? ??? ?? ????????? ?? ???? ??? ?? ????? ??? ?? ?????? .ascx ????? ?? ???-behind ????? ??? ??????? ?? ??? ??? ?????? ????
?????????? ???????? 1 (FragmentCtrl1.ascx)????? ?????????? ????????, FragmentCtrl1.ascx, ???? ??? ??? FragmentCtrl1.ascx ?? ??? ???? ?? ??? ??? ????????? ???? ?? ????? ??? ??? ???????? ?? ?? ???? ?? ??? ????? ?? ??? ???, ?? ??? ?? ??? ????? ???????? ???????? ?? ??????? ??????? ????? ??? ??? ???????? ??? ???? ???? ?? ??? ???? ????? ?? ??? ?????? ???? ???
????? ???????? ????NET, ?? ??? ?????????? ???????? ??????????? ?????:?????? Explorer ??? ????????? ??? ????-????? ????, ?????? ?? ????? ????, ?? ???? ??? ??? ?????????? ???????? ?????? . FragmentCtrl1.ascx ???????? ?? ??? ???, ?? ?? ????? ????? ????? ????????? ???? ?? ??????? ??? ????? ??? ????? ???? ?? ?? ??? ??????? ???? ???????? ??? ????????? ?? ?? ?????? ????? ?? ??????, ?? ????? ?? ???? ???????? ????? ???? ???????? ????? ????? ????? ???????? ?? ??? ??? ??????? ?????? ????? ?????? (IDE), ?????? CacheEntryTime ID ???, ?? ??? ??? ????? ???????HTML ????? ??? ????? ????, ?? ????? @ OutputCache ?????????? ??? ??????????? ?????? ????? ?? ????? ??:
<%@ OutputCache Duration="40" VaryByParam="none"%>
.Ascx ????? ?? ????-????? ????, ?? ?? ????? ????? ???-behind ????????? ???? ?? ??? ??? ????? ????? ????? CacheEntryTime ???? ?? ??? ??? ??? ???? ??, ?????? Page_Load ???? ?? ???, ?????????? ??? ??????:
private void Page_Load(object sender, System.EventArgs e)
{
CacheEntryTime.Text ="FragmentCtrl1: " + DateTime.Now.TimeOfDay.ToString();
}
?????????? ???????? 2 (FragmentCtrl2.ascx)???? ?????? ?????????? ???????? ???????? ??????? ??? ?? ?? ????? ?? ???? ???, ?? ?????? ?? ??? ??? ????? ??? ?? ???? ?? ???? ???????? ?? ???? ???? ??????? ?? ??? ???? ???, ??????? ?? ???, FragmentCtrl2.ascx, interesting ?? ????? ???????? ????? ??? FragmentCtrl2.ascx
VaryByControl ??????? ????? ???? ?? ??? ????? ???? ???? ???
VaryByControl ??????? ??? ???????????? ???? ????????? ???????? ?? ??? ?? ?????? ??? ???? ?? ??? ?????? ???? ??? ?? ??????????? ????? ??? ???? ??? ??? ???? clearer ????? ???
????? ???????? ????NET, ?? ??? ?????????? ???????? ??????????? ?????:?????? Explorer ??? ????????? ??? ????-????? ????, ?????? ?? ????? ????, ?? ???? ??? ??? ?????????? ???????? ?????? . FragmentCtrl2.ascx ???????? ?? ??? ???, ?? ?? ????? ????? ????? ????????? ???? ?? ??????? ??? ????? ??? ????? ???? ?? ??? ??????? ??? ????? ?? ??? ??? ??????? ???? ???????? ??????, ?? ?? ????? ?? ???? ???????? ????? ???? ???????? ????? ????? ??? ??? ???, ???? ???? CacheEntryTime ID ???, ?? ??? ??? ????? ??????????? ???????? ?? ??? ???? ????? ????, ?? ?? ?? ????? ??? ???? ?????? ??? ?? ???? ?? ??? ENTER ??????????? ???? ?? ?? ??? ??????? RadioButtonList ???????? ??? ????????? ?? ?? ?????? ????? ?? ??????, ?? ????? ?? ???? ???? RadioButtonList ???????? ????? ?????? ???? ???????? ?? ??? ???? ?? ? ???? ?????? RadioButtonList ???????? ????? ????? ??? ??? ???, ???? ???? MyRadioButtonList ID ??? ??????? ??? ????? ?? MyRadioButtonList ???????? ?? ??? ???? ??? ?? ?????, ?????? ????? ????, ?? ?? ?????? ?? ??? ????? ???? ?? ?????????? (...) ??? ????? ????? ListItem ?????? ?????? ????? ???, ListItem ??????? ?? ?? ??? ??? ??????:????? ?? ???????, ?????? ????? ?????ListItem ??? ?????? ??? ??? ?? ??? ??? ?? ??? ???, ?? ???? True ?? ??? ?????????? ?? ???????, ?????? ???? ????? ?????ListItem ??? ?????? ??? ??? ?? ??? ??? ???? ?? ??? ???? , ?? ???? False ?? ??? ?????????? ?? ???????, ?? ????? ??? ?????? ????? ?????ListItem ??? ?????? ??? ???? ???? ?? ??? ??? ?? ??? ???, ?? ???? False ?? ??? ???????????? ????? ??? .ascx ????? ?? ????? ?? ??? ??? ????? ????? ?????? ?? ??? ??? ????? ????? ?? RadioButtonList ???????? ?? ???? ????? ???: ??? , ???? , ?? ?????? ? ?????? ????? ???? ??? RadioButtonList ???????? ?? ????? ??? ???? ?????? ??? ?? ???? ?? ??? ENTER ?????? ????? ???? ?? ??? ??????? ??? ????? ?? ??? ??? ??????? ??? ???????? ??????, ?? ?? ????? ?? ??????? ??? ???????? ????? ?????? RadioButtonList ???????? ?? ??? ???? ?? ? ???? ?????? ??? ???????? ????? ????? ??? ??? ???, ???? ???? ????? ???? ??????? ??? ????HTML ????? ??? ????? ????, ?? ????? @ OutputCache ?????????? ??? ??????????? ?????? ????? ?? ????? ??:
<%@ OutputCache Duration="60" VaryByParam="none" VaryByControl="MyRadioButtonList"%>
.Ascx ????? ?? ????-????? ????, ?? ?? ????? ????? ???-behind ????????? ???? ?? ??? ??? ????? ????? ????? CacheEntryTime ???? ?? ??? ??? ??? ???? ??, ?????? Page_Load ???? ?? ???, ?????????? ??? ??????:
private void Page_Load(object sender, System.EventArgs e)
{
CacheEntryTime.Text = "FragmentCtrl2: " + DateTime.Now.TimeOfDay.ToString();
}
?????????? ???????? ????? ???? ?? ??? ??? ??????? ??????? ?? ??? developed ?? ?????????? ???????? ???? ?? ??? ??????? (.aspx) ??? ???? ???? ??? ??????? ????? ?? ???, ????? ????? ?? ???? ????:
?? ??? ??????? ????? ???????? ??? ???? ????????? ?? ??? FragmentCaching.aspx ?? ??? ???????NET ???????????:?????? Explorer ??? ????????? ??? ????-????? ????, ?????? ?? ????? ????, ?? ???? ??? ??? ??????? ?????? . ??? ??????? FragmentCaching.aspx ?? ??? ???, ?? ?? ????? ????? ????? ????????? ???? ?? ??????? ??? ????? ??? ????? ???? ?? ??? ??? ??????? ???? ???????? ??? ????????? ?? ?? ?????? ????? ?? ??????, ?? ????? ?? ??????? ???? ???????? ????? ????? ??? ??? ???, ???? ???? ??? ID ???, ?? ??? ??? ????? ????????????? ????? ???? ??? ???? ???????? ?? ????? ??? ???? ?????? ??? ?? ???? ?? ??? ENTER ?????? FragmentCtrl1.ascx ??????, ?? ???? ??? ??? ???? ???????? ???? ?? ????? ?????? ????? ?? ?? ??? ??????? ?? ????? ???? ???????? ?? ??? ????? ????, ?? ????? ??? ???? ?????? ??? ?? ???? ?? ??? ENTER ?????? FragmentCtrl2.ascx ??????, ?? ???? ??? ??? FragmentCtrl1.ascx ?? ???? ????? ?????? ????? ?? ??? ??? ????? ?? ???? ???? HTML ????? ???, ??? ??????? ?? ????? ??? ?? ??? ????? ?????:
<%@ Page language ="c#" Codebehind="FragmentCaching.aspx.cs"
AutoEventWireup="false" Inherits="FragmentCache.FragmentCaching" %>
<%@ Register TagPrefix="uc1" TagName="FragmentCtrl1" Src="FragmentCtrl1.ascx" %>
<%@ Register TagPrefix="uc1" TagName="FragmentCtrl2" Src="FragmentCtrl2.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript (ECMAScript)">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="FragmentCaching" method="post" runat="server">
<P>
WebForm Time:
<asp:Label id="Time" runat="server" ForeColor="Blue"></asp:Label>
</P>
<P>
<uc1:FragmentCtrl1 id="FragmentCtrl11" runat="server">
</uc1:FragmentCtrl1>
</P>
<P>
<uc1:FragmentCtrl2 id="FragmentCtrl21" runat="server">
</uc1:FragmentCtrl2>
</P>
</form>
</body>
</HTML>
??? : ????????? ???? ?? ???????? ?? ???? ??? ?? ?? .Aspx ????? ?? ????-????? ????, ?? ?? ????? ????? ???-behind ????????? ???? ?? ??? ??? ????? ????? ????? ??? ??? ???? ?? ??? ??? ??? Page_Load ???? ?? ???, ?????????? ??? ??????:
private void Page_Load(object sender, System.EventArgs e)
{
Time.Text = "WebFormTime: " + DateTime.Now.TimeOfDay.ToString();
}
????? ' ???? ??, ?????????? ????????, ??? ???????, ?? ???? ??????? ????????? ??????? ?????? ?? ??? ??? ?????? ????? ?????????? ???? ?? ????? ???????? ????NET ?????? ????? ?????? (IDE), ????????? ????? ?? ??? ????? ????? ????? ????? ??????? ?????? ???, ?????? ??????? witness ?? ????? ??? ?? ??? ?? ????? ?? ??? ???? ????????? ???? ?? ?? ?? ????? ?? ???? ??? ????? ??? ????? ??? ????? ??? ????????? ???? ?? ???
????? ???????? ????IDE ?????? Explorer ???, FragmentCaching.aspx ??? ??????? ?? ????-????? ????, ?? ??? ??? ?? ????? ?? ??? ???????? ??? ????? ????? ????? ???????? ??? ??? ????? ???? ?? ?? ???, ????? ?? ????-????? ????, ?? ?? ????? ?? ????? ???? ?? ??? ????? ???? ????? ????? ??? ?? ?? ????? ???????? ?? ??? ????? ???? ???????? ??? ??? ??? ??? ???, ?? ??? ????? ???? ?? ??? F5 ????? ??? ???? ??????? IDE. ????? ??? ?? ??? ??????? ?? ??? ?????? ???? ??? ??, ????? ?????????? ???????? ??? ?? ?? ???? ??????? ??? ????????? ???? ??? ??? ????????? ????? ???????? ??? ????? ???? ????? ????? ????? ??? ?? ???????? ?? ?????? ???? ??? ??? ????????? ???? ??? ?? VaryByControl ??????? ?????? ?? RadioButtonList ???????? ?? ???????? ???? ?? ?????????? ???????? ?? ??? ????? ??? ??? ???? ????? ????, ?? ?? ???: ????? ????? ????? ??? ??? ?? ?????????? ???????? ?? ???????? ??? ??????? ?? ???? ?? ?? ????? ???? ??? ????? ?? ??????? ?? ???? ??? ?????? ?? ?????? ???????? ?? ??? ??? ??? ??? ????????? ??? ?? ????????? ?????? ?? ????? ?? ??? ?? ???????? ??? ?? ???? ??????? ??????? ????? ????, ?? ?? ???: ????? ????? ????? ???? ?? ?????? ???????? ?? ??? ?? ????????? ?? ???????? ????? ??? ?? ?? ????? ???????? ?? ??? ????? ???, ?? ?? ????? ??? ????????? ??? ????????? ????? ?????????? ??? @ OutputCache ??????????? ?? ???? ?????? ????? ????? ???? ?? ??? ???? ???? ???, ?? ?????????? ???????? ?? ??? ???????? ??????? ??? ??? RadioButtonList ???????? ?? ??? ?????? ?????? : ??? ???? ???????? ?? ???????? ??? ?????? ?? ??? ??? ???? ?? ??? ?? ???? ?? ?????? ???? ??? ???? ??????? ?? ???, ?????
?????? ?? ???? ?? ??? ??? ???????
?????? ???????????? ??? ?? ?????????? ???????? ????????? ??????? ???? ?? ?????? ????? ??? ????? ?? ??????? ?? ??? ????????? ???? ?? ???? ???? ?? ?? ???? ??? ????? ???? ??, ?? ???????? ???? ?????? ??? ?? ????? ???? ??? ??? ???????? ?????? ??? satisfies ?? ???????? ??? ???? ??????? ??? ??????? ???????? ?? ?????????? ?? ????? ???? ??? ?? ?????????? ???????? ?? ???? ??? ?? ?????? ?? ?? ?????? ??? ???? ??, ??? ??????? ?? ?????? ???????? ?????? ??????? dictates. ASP ?? ???? ??? ???????? ??????? ?? ????NET ?????? ?? ???, Microsoft ???????? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
307225
(http://support.microsoft.com/kb/307225/EN-US/
)
?????: ASP.??? ?????? ??????
???? ???? ???? ??: Microsoft ASP.NET 1.1 Microsoft ASP.NET 1.0 Microsoft Visual C# .NET 2003 Standard Edition Microsoft Visual C# .NET 2002 Standard Edition kbcaching kbhowtomaster kbservercontrols kbwebforms kbmt KB308378 KbMthi
???? ?????? ???????? ??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:
308378
(http://support.microsoft.com/kb/308378/en-us/
)
Was this information helpful?
How much effort did you personally put forth to use this article?
Tell us why and what can we do to improve this information
Thank you! Your feedback is used to help us improve our support content. For more assistance options, please visit the
Help and Support Home Page .
???? ?????? ???? ?????? ??????
??????
??? ?????? ??????? ????
???? ??????