OutputCacheProfile.Duration Egenskap

Definition

Hämtar eller anger den tid under vilken sidan eller kontrollen cachelagras.

public:
 property int Duration { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("duration", DefaultValue=-1)]
public int Duration { get; set; }
[<System.Configuration.ConfigurationProperty("duration", DefaultValue=-1)>]
member this.Duration : int with get, set
Public Property Duration As Integer

Egenskapsvärde

Tidsvaraktighet i sekunder.

Attribut

Exempel

Följande kodexempel visar hur du använder egenskapen Duration .


// Get the current Duration.
Int32 durationValue = 
    outputCacheProfile.Duration;

// Set the Duration property to 0.
outputCacheProfile.Duration = 0;
  ' Get the current Duration.
  Dim durationValue As Int32 = _
  outputCacheProfile.Duration

  ' Set the Duration.
outputCacheProfile.Duration = 0

Kommentarer

Duration Representerar tiden i sekunder som sidan eller användarkontrollen cachelagras. Om du anger den här egenskapen upprättas en förfalloprincip för HTTP-svar från sidan eller kontrollen som den gäller för och orsakar automatiskt cachelagring av deras utdata.

Note

Duration Måste definieras i profilen eller direktivet för @ OutputCache en sida med hjälp av profilen.

Gäller för

Se även