PagesEnableSessionState Výčet

Definice

Slouží k určení aktivace stavu relace pro jednu webovou stránku nebo celou webovou aplikaci.

public enum class PagesEnableSessionState
public enum PagesEnableSessionState
type PagesEnableSessionState = 
Public Enum PagesEnableSessionState
Dědičnost
PagesEnableSessionState

Pole

False 0

Stav relace je zakázaný.

ReadOnly 1

Stav relace je povolený, ale nedá se zapisovat.

True 2

Stav relace je povolený.

Příklady

Následující výňatek konfiguračního souboru ukazuje, jak deklarativně používat hodnoty výčtu PagesEnableSessionState k určení, zda je povolen stav relace.

<system.web>
  <pages enableSessionState="true" />
</system.web>

Následující příklad kódu ukazuje, jak použít PagesEnableSessionState výčet s typem PagesSection .

// Get the current EnableSessionState property value.
Console.WriteLine(
    "Current EnableSessionState value: '{0}'",
    pagesSection.EnableSessionState);

// Set the EnableSessionState property to
// PagesEnableSessionState.ReadOnly.
pagesSection.EnableSessionState =
    PagesEnableSessionState.ReadOnly;
' Get the current EnableSessionState property value.
Console.WriteLine( _
    "Current EnableSessionState value: '{0}'", pagesSection.EnableSessionState)

' Set the EnableSessionState property to
' PagesEnableSessionState.ReadOnly.
pagesSection.EnableSessionState = PagesEnableSessionState.ReadOnly

Poznámky

Tento výčet určuje aktivaci stavu relace pro celou webovou aplikaci. Tuto hodnotu lze použít v pages části konfiguračního souboru k ovlivnění všech stránek .aspx ve webové aplikaci pro obor konfiguračního souboru. Typ PagesSection umožňuje programový přístup k oddílu pages konfigurace.

Platí pro

Viz také