PartialCachingAttribute.VaryByControls Propriedade

Definição

Obtém uma lista de propriedades de controle de usuário que o cache de saída usa para variar o controle de usuário.

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

Valor da propriedade

A lista de propriedades de controle do usuário.

Exemplos

O exemplo de código a seguir demonstra como o PartialCachingAttribute(Int32, String, String, String) construtor pode ser aplicado a um controle de usuário. No exemplo, o construtor é usado para indicar que o controle de usuário pode ser armazenado em cache, especificar a duração do cache como 20 segundos e especificar um controle chamado state para o qual a saída do controle do usuário será variada.

// 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

Aplica-se a