Sdílet prostřednictvím


SystemWebCachingSectionGroup.OutputCacheSettings Vlastnost

Definice

outputCacheSettings Získá oddíl obsažený v konfiguraci.

public:
 property System::Web::Configuration::OutputCacheSettingsSection ^ OutputCacheSettings { System::Web::Configuration::OutputCacheSettingsSection ^ get(); };
[System.Configuration.ConfigurationProperty("outputCacheSettings")]
public System.Web.Configuration.OutputCacheSettingsSection OutputCacheSettings { get; }
[<System.Configuration.ConfigurationProperty("outputCacheSettings")>]
member this.OutputCacheSettings : System.Web.Configuration.OutputCacheSettingsSection
Public ReadOnly Property OutputCacheSettings As OutputCacheSettingsSection

Hodnota vlastnosti

OutputCacheSettingsSection

Objekt OutputCacheSettingsSection

Atributy

Příklady

Následující příklad kódu ukazuje, jak získat OutputCacheSettingsSection objekt z konfiguračního souboru existující webové aplikace.


// Get the .<outputCacheSettings> section
OutputCacheSettingsSection outputCacheSettings=
    cachingSectionGroup.OutputCacheSettings;

// Display the number of existing 
// profiles.
int profilesCount = 
    outputCacheSettings.OutputCacheProfiles.Count;
msg = String.Format(
"Number of profiles: {0}\n",
profilesCount.ToString());

Console.Write(msg);
' Get the .<outputCacheSettings> section
Dim outputCacheSettings _
As OutputCacheSettingsSection = _
cachingSectionGroup.OutputCacheSettings

' Display the number of existing 
' profiles.
Dim profilesCount As Integer = _
outputCacheSettings.OutputCacheProfiles.Count
msg = String.Format( _
"Number of profiles: {0}" + _
ControlChars.Lf, profilesCount.ToString())

Console.Write(msg)

Poznámky

Objekt OutputCacheSettingsSection odkazuje na outputCacheSettings část konfiguračního souboru.

Nastavení výstupní mezipaměti povolí nebo zakáže trvalou výstupní mezipaměť založenou na disku, definuje umístění pro uchování dat, která se mají ukládat do mezipaměti, a zadejte maximální velikost mezipaměti pro každou aplikaci.

ASP.NET umožňuje deklarativní ukládání více verzí odpovědi stránky do mezipaměti pomocí atributů direktivy @ OutputCache a programově pomocí vlastností a metod HttpCachePolicy třídy.

Stejné výsledky můžete dosáhnout konfigurací aplikace pomocí OutputCacheSettingsSection typu nebo OutputCacheProfile typu.

Platí pro

Viz také