Export (0) Print
Expand All

PartialCachingAttribute.VaryByCustom Property

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

[Visual Basic]
Public ReadOnly Property VaryByCustom As String
[C#]
public string VaryByCustom {get;}
[C++]
public: __property String* get_VaryByCustom();
[JScript]
public function get VaryByCustom() : String;

Property Value

The list of custom strings.

Remarks

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.

Example

[Visual Basic] 
' Set the PartialCachingAttribute.Duration property to
' 20 seconds and the PartialCachingAttribute.VaryByCustom
' property to browser.
<PartialCaching(20, Nothing, Nothing, "browser")>  _
Public Class ctlSelect
   Inherits UserControl

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

[C++] 
// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByCustom
// property to browser.
[PartialCaching(20, 0, 0, S"browser")]
public __gc class ctlSelect : public UserControl

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

PartialCachingAttribute Class | PartialCachingAttribute Members | System.Web.UI Namespace

Show:
© 2015 Microsoft