PartialCachingAttribute.VaryByParams Eigenschaft

Definition

Ruft eine Liste von Abfragezeichenfolgen oder Formular-POST-Parametern ab, die vom Ausgabecache zum Variieren des Benutzersteuerelements verwendet werden.

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

Eigenschaftswert

String

Die Liste der Abfragezeichenfolgen oder Formular-POST-Parameter.

Beispiele

Im folgenden Codebeispiel wird veranschaulicht, wie der PartialCachingAttribute(Int32, String, String, String) Konstruktor auf ein Benutzersteuerelement angewendet werden kann. Im Beispiel wird der Konstruktor verwendet, um anzugeben, dass das Benutzersteuerelement zwischengespeichert werden kann und um den Parameter anzugeben, nach dem der Cacheeintrag abhängig ist.

// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByParams
// property to ctlSelect.country, the full name of the form 
// POST parameter generated by the country DropDownList control.
[PartialCaching(20, "ctlSelect.country", null, null)]
public partial class ctlSelect : UserControl
' Set the PartialCachingAttribute.Duration property to
' 20 seconds and the PartialCachingAttribute.VaryByParams
' property to ctlSelect.country, the full name of the form 
' POST parameter generated by the country DropDownList control.
<PartialCaching(20, "ctlSelect.country", Nothing, Nothing)> _
Public Class ctlSelect
    Inherits UserControl

Gilt für