Share via


PartialCachingAttribute.VaryByControls Vlastnost

Definice

Získá seznam vlastností uživatelského ovládacího prvku, které výstupní mezipaměť používá k odlišování uživatelského ovládacího prvku.

public:
 property System::String ^ VaryByControls { System::String ^ get(); };
public:
 property System::String ^ VaryByControls { System::String ^ get(); void set(System::String ^ value); };
public string VaryByControls { get; }
public string VaryByControls { get; set; }
member this.VaryByControls : string
member this.VaryByControls : string with get, set
Public ReadOnly Property VaryByControls As String
Public Property VaryByControls As String

Hodnota vlastnosti

Seznam vlastností uživatelského ovládacího prvku.

Příklady

Následující příklad kódu ukazuje, jak PartialCachingAttribute(Int32, String, String, String) lze konstruktor použít na uživatelský ovládací prvek. V příkladu se konstruktor používá k označení, že uživatelský ovládací prvek lze uložit do mezipaměti, k určení doby trvání ukládání do mezipaměti jako 20 sekund a k určení ovládacího prvku s názvem state , pro který bude výstup uživatelského ovládacího prvku změněn.

// 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)]
' 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

Platí pro