2

When I tried to get the SessionId of the user session in aspx page like below, it returns nothing

default.aspx

Session ID : <% Session.SessionID.ToString(); %>

but if I use a literal and try to assign sessionId to it in the page_load, it works. So which lifecycle step that aspx page is being loaded to the page ? Why this happening ?

Thanks,

1 Answer 1

3

Try this (note the equal sign and no semicolon):

Session ID : <%= Session.SessionID.ToString() %>

...and this list of server tags will help you in the future:

http://forums.asp.net/p/1139381/1828702.aspx#1828702

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.