PartialCachingAttribute.VaryByControls Propiedad

Definición

Obtiene una lista de propiedades de control de usuario que utiliza la caché de resultados para modificar el control de usuario.

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 de propiedad

Lista de propiedades de control de usuario.

Ejemplos

En el ejemplo de código siguiente se muestra cómo se puede aplicar el PartialCachingAttribute(Int32, String, String, String) constructor a un control de usuario. En el ejemplo, el constructor se usa para indicar que el control de usuario se puede almacenar en caché, especificar la duración del almacenamiento en caché como 20 segundos y especificar un control denominado state para el que se variará la salida del control de usuario.

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

Se aplica a