Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

PartialCachingAttribute Constructor (Int32, String, String, String, Boolean)

Initializes a new instance of the PartialCachingAttribute class, specifying the caching duration, any GET and POST values, control names, custom output caching requirements used to vary the cache, and whether the user control output can be shared with multiple pages.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)
public PartialCachingAttribute(
	int duration,
	string varyByParams,
	string varyByControls,
	string varyByCustom,
	bool shared
)

Parameters

duration
Type: System.Int32

The amount of time, in seconds, that the user control is cached.

varyByParams
Type: System.String

A semicolon-separated list of strings used to vary the output cache. By default, these strings correspond to a query string value sent with GET method attributes, or a parameter sent using the POST method. When this attribute is set to multiple parameters, the output cache contains a different version of the requested document for each specified parameter. Possible values include "none", "*", and any valid query string or POST parameter name.

varyByControls
Type: System.String

A semicolon-separated list of strings used to vary the output cache. These strings represent fully qualified names of properties on a user control. When this parameter is used for a user control, the user control output is varied to the cache for each specified user control property.

varyByCustom
Type: System.String

Any text that represents custom output caching requirements. If this parameter is given a value of "browser", the cache is varied by browser name and major version information. If a custom string is entered, you must override the HttpApplication.GetVaryByCustomString method in your application's Global.asax file.

shared
Type: System.Boolean

true to indicate that the user control output can be shared with multiple pages; otherwise, false.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.