Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PartialCachingAttribute Constructor (Int32, String^, String^, String^)

 

Initializes a new instance of the PartialCachingAttribute class, specifying the caching duration, any GET and POST values, control names, and custom output caching requirements used to vary the cache.

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

public:
PartialCachingAttribute(
	int duration,
	String^ varyByParams,
	String^ varyByControls,
	String^ varyByCustom
)

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 to 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.

The following code example demonstrates how the PartialCachingAttribute(Int32, String^, String^, String^) constructor can be applied to a user control. In the example, the constructor is used to indicate that the user control can be cached, specify the caching duration as 20 seconds, and specify a control named state for which the user control output will be varied.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft