Export (0) Print
Expand All

PartialCachingAttribute.VaryByControls Property

Gets a list of user control properties that the output cache uses to vary the user control.

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

Property Value

The list of user control properties.

Example

[Visual Basic] 
' Set the PartialCachingAttribute.Duration property to
' 20 seconds and the PartialCachingAttribute.VaryByControls
' property to the ID of the server control to vary the output by.
' In this case, it is state, the ID assigned to a DropDownList
' server control.
<PartialCaching(20, Nothing, "state", Nothing)>  _
Public Class ctlSelect
  Inherits UserControl

[C#] 
// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByControls
// property to the ID of the server control to vary the output by.
// In this case, it is state, the ID assigned to a DropDownList
// server control.
[PartialCaching(20, null, "state", null)]

[C++] 
// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByControls
// property to the ID of the server control to vary the output by.
// In this case, it is state, the ID assigned to a DropDownList
// server control.
[PartialCaching(20, 0, S"state", 0)]

[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:
© 2014 Microsoft