PagesSection.EnableSessionState Vlastnost

Definice

Získá nebo nastaví hodnotu, která určuje, zda je stav relace povolen, zakázán nebo jen pro čtení.

public:
 property System::Web::Configuration::PagesEnableSessionState EnableSessionState { System::Web::Configuration::PagesEnableSessionState get(); void set(System::Web::Configuration::PagesEnableSessionState value); };
[System.Configuration.ConfigurationProperty("enableSessionState", DefaultValue="true")]
public System.Web.Configuration.PagesEnableSessionState EnableSessionState { get; set; }
[<System.Configuration.ConfigurationProperty("enableSessionState", DefaultValue="true")>]
member this.EnableSessionState : System.Web.Configuration.PagesEnableSessionState with get, set
Public Property EnableSessionState As PagesEnableSessionState

Hodnota vlastnosti

Jedna z hodnot vlastnosti, která určuje, jestli je stav relace povolený, zakázaný nebo jen pro EnableSessionState čtení. Výchozí hodnota je True, což znamená, že stav relace je povolený.

Atributy

Výjimky

Hodnota není platná PagesEnableSessionState hodnota výčtu.

Příklady

Následující příklad kódu ukazuje, jak použít EnableSessionState vlastnost .

// 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

Platí pro

Viz také