PagesEnableSessionState Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Used to determine session-state activation for a single Web page or an entire Web application.
public enum class PagesEnableSessionState
public enum PagesEnableSessionState
type PagesEnableSessionState =
Public Enum PagesEnableSessionState
- Inheritance
Fields
False | 0 | Session state is disabled. |
ReadOnly | 1 | Session state is enabled, but not writable. |
True | 2 | Session state is enabled. |
Examples
The following configuration file excerpt shows how to declaratively use values of the PagesEnableSessionState enumeration to specify whether the session state is enabled.
<system.web>
<pages enableSessionState="true" />
</system.web>
The following code example shows how to use the PagesEnableSessionState enumeration with the PagesSection type.
// 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
Remarks
This enumeration determines session-state activation for an entire Web application. This value can be used in the pages
configuration-file section to affect all .aspx pages in the Web application for the scope of the configuration file. The PagesSection type allows programmatic access to the pages
configuration section.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기