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

PartialCachingAttribute.VaryByCustom Property

Gets a list of custom strings that the output cache will use to vary the user control.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
public string VaryByCustom { get; }
/** @property */
public String get_VaryByCustom ()

public function get VaryByCustom () : String

Not applicable.

Property Value

The list of custom strings.

If you specify browser for this property, the user control will be varied by browser type and major version number. You can also use this property to extend the values that output cache varies the user control response.

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 and to specify that the cache entry is dependent on the browser type and major version number.

// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByCustom
// property to browser.
[PartialCaching(20, null, null, "browser")]
public partial class ctlSelect : UserControl

// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByCustom
// property to browser.
/** @attribute PartialCaching(20, null, null, "browser")
 */
public class ctlSelect extends UserControl

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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.