Page.Session 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
ASP.NET에서 제공하는 현재 Session
개체를 가져옵니다.
public:
virtual property System::Web::SessionState::HttpSessionState ^ Session { System::Web::SessionState::HttpSessionState ^ get(); };
[System.ComponentModel.Browsable(false)]
public virtual System.Web.SessionState.HttpSessionState Session { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Session : System.Web.SessionState.HttpSessionState
Public Overridable ReadOnly Property Session As HttpSessionState
속성 값
현재 세션 상태 데이터입니다.
- 특성
예외
세션 정보가 null
로 설정된 경우
예제
다음 코드 예제에서는 Web Forms 페이지의 세션 상태에 저장된 키를 검색하고 해당 값을 문자열로 변환하는 함수를 만듭니다GetStyle
.
// Create a private function that obtains
// information stored in Session state
// in the application's Global.asax file.
// When this method is called and a key name
// that is stored in Session state is passed
// as the paramter, the key is obtained and
// converted to a string.
String GetStyle(String key) {
return Session[key].ToString();
}
' Create a private function that obtains
' information stored in session state
' in the application's Global.asax file.
' When this method is called and a key name
' that is stored in session state is passed
' as the parameter, the key is obtained and
' converted to a string.
Function GetStyle(Key As String) As String
Return Session(Key).ToString()
End Function
설명
이 속성은 현재 요청의 세션에 대한 정보를 제공합니다. Session
ASP.NET 애플리케이션에서 페이지 또는 문서를 요청 하는 각 사용자에 대해 유지 되는 개체입니다. 에 저장 된 변수는 Session
애플리케이션에서 페이지를 이동 하면 개체가 삭제 되지 않으며, 이러한 변수도 사용자가 애플리케이션에서 페이지를 액세스를 유지 하는 대신 합니다. 세션 상태에 대한 자세한 내용은 ASP.NET 세션 상태 개요를 참조하세요.