Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
BasePartialCachingControl Class

Updated: November 2007

Provides the base functionality for the StaticPartialCachingControl and PartialCachingControl classes.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)

Visual Basic (Declaration)
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public MustInherit Class BasePartialCachingControl _
    Inherits Control
Visual Basic (Usage)
Dim instance As BasePartialCachingControl
C#
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class BasePartialCachingControl : Control
Visual C++
[AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)]
public ref class BasePartialCachingControl abstract : public Control
J#
/** @attribute AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal) */
/** @attribute AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal) */
public abstract class BasePartialCachingControl extends Control
JScript
public abstract class BasePartialCachingControl extends Control
ASP.NET
<asp:BasePartialCachingControl />

The BasePartialCachingControl class represents a user control that has output caching enabled in programmatic scenarios. ASP.NET provides several ways to enable output caching for a control. The following list describes methods you can use to enable output caching:

  • Use the @ OutputCache directive to enable output caching in declarative scenarios.

  • Use the PartialCachingAttribute class to enable caching for a user control in a code-behind file.

  • Use the ControlCachePolicy class to specify cache settings in programmatic scenarios in which you are working with BasePartialCachingControl instances.

TopicLocation
How to: Cache Page Output with Cache Key DependenciesBuilding ASP .NET Web Applications
How to: Cache Page Output with Cache Key DependenciesBuilding ASP .NET Web Applications
How to: Cache Page Output with Cache Key DependenciesBuilding ASP .NET Web Applications in Visual Studio
How to: Cache Page Output with File DependenciesBuilding ASP .NET Web Applications
How to: Cache Page Output with File DependenciesBuilding ASP .NET Web Applications
How to: Cache Page Output with File DependenciesBuilding ASP .NET Web Applications in Visual Studio
How to: Cache Versions of a Page Using HTTP HeadersBuilding ASP .NET Web Applications
How to: Cache Versions of a Page Using HTTP HeadersBuilding ASP .NET Web Applications
How to: Cache Versions of a Page Using HTTP HeadersBuilding ASP .NET Web Applications in Visual Studio
How to: Cache Versions of a Page Using Requesting BrowserBuilding ASP .NET Web Applications
How to: Cache Versions of a Page Using Requesting BrowserBuilding ASP .NET Web Applications
How to: Cache Versions of a Page Using Requesting BrowserBuilding ASP .NET Web Applications in Visual Studio
How to: Retrieve Values of Cached ItemsBuilding ASP .NET Web Applications
How to: Retrieve Values of Cached ItemsBuilding ASP .NET Web Applications
How to: Retrieve Values of Cached ItemsBuilding ASP .NET Web Applications in Visual Studio
How to: Set Expiration Values for ASP.NET Page CachingBuilding ASP .NET Web Applications
How to: Set Expiration Values for ASP.NET Page CachingBuilding ASP .NET Web Applications
How to: Set Expiration Values for ASP.NET Page CachingBuilding ASP .NET Web Applications in Visual Studio
How to: Set the Cacheability of an ASP.NET Page DeclarativelyBuilding ASP .NET Web Applications
How to: Set the Cacheability of an ASP.NET Page DeclarativelyBuilding ASP .NET Web Applications
How to: Set the Cacheability of an ASP.NET Page DeclarativelyBuilding ASP .NET Web Applications in Visual Studio
How to: Set the Cacheability of an ASP.NET Page ProgrammaticallyBuilding ASP .NET Web Applications
How to: Set the Cacheability of an ASP.NET Page ProgrammaticallyBuilding ASP .NET Web Applications
How to: Set the Cacheability of an ASP.NET Page ProgrammaticallyBuilding ASP .NET Web Applications in Visual Studio

The following code example demonstrates how to create a reference to the BasePartialCachingControl class and sets it to the value of the Parent property. The code then sets the Dependency property to a CacheDependency object that makes the control dependent on a text file.

Visual Basic
Sub Page_Load(sender As [Object], ev As EventArgs)
   Dim c As BasePartialCachingControl = Parent 
      If Not (c Is Nothing) Then
      c.Dependency = New CacheDependency(MapPath("dep1.txt"))
   End If
End Sub 'Page_Load

C#
void Page_Load(Object sender, EventArgs ev) {
    BasePartialCachingControl c = Parent as BasePartialCachingControl;
    if (c != null) {
      c.Dependency = new CacheDependency(MapPath("dep1.txt"));
    }
}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker