PartialCachingAttribute.VaryByCustom Propriété

Définition

Obtient la liste des chaînes personnalisées que le cache de sortie utilisera pour faire varier le contrôle utilisateur.

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

Valeur de propriété

Liste de chaînes personnalisées.

Exemples

L’exemple de code suivant montre comment le PartialCachingAttribute(Int32, String, String, String) constructeur peut être appliqué à un contrôle utilisateur. Dans l’exemple, le constructeur est utilisé pour indiquer que le contrôle utilisateur peut être mis en cache et pour spécifier que l’entrée de cache dépend du type de navigateur et du numéro de version principale.

// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByCustom
// property to browser.
[PartialCaching(20, null, null, "browser")]
public partial class ctlSelect : UserControl
' Set the PartialCachingAttribute.Duration property to
' 20 seconds and the PartialCachingAttribute.VaryByCustom
' property to browser.
<PartialCaching(20, Nothing, Nothing, "browser")> _
Public Class ctlSelect
    Inherits UserControl

Remarques

Si vous spécifiez « browser » pour cette propriété, le contrôle utilisateur est variable selon le type de navigateur et le numéro de version principale. Vous pouvez également utiliser cette propriété pour étendre les valeurs que le cache de sortie varie selon la réponse du contrôle utilisateur.

S’applique à