2
.cshtml 페이지에 모든 세션 변수를 표시하는 가장 좋은 방법은 무엇입니까? .cshtml 페이지의 모든 세션 변수 표시
는@HttpContext.Current.Session();
를 사용하여 시도하지만 아무것도 보이지 않았다.
.cshtml 페이지에 모든 세션 변수를 표시하는 가장 좋은 방법은 무엇입니까? .cshtml 페이지의 모든 세션 변수 표시
는@HttpContext.Current.Session();
를 사용하여 시도하지만 아무것도 보이지 않았다.
이 검증되지 않은,하지만 작동합니다 :
@{ var session = HttpContext.Current.Session; }
@foreach (string key in session.Keys) {
<p>Key: @key - Value: @session[key].ToString()</p>
}
완벽한! 잘 작동합니다. –
볼 http://www.xyzws.com/JSPfaq/how-to-display-all-the-session-variables-in-an-html -page/33 –