SessionID

R

Ramon Rocha

Dear friends,

Line code bellow is returning message error:
Dim strSID As String = Session.SessionID.ToString
Using <%@ Page Language="VB" EnableSessionState="True" %>

Exception Details: System.Web.HttpException: Session state can only be used
when enableSessionState is set to true, either in a configuration file or in
the Page directive. Please also make sure that System.Web.SessionStateModule
or a custom session state module is included in the
<configuration>\<system.web>\<httpModules> section in the application
configuration.

web.config
<httpModules>

<add name="Session" type="System.Web.SessionState.SessionStateModule"/>

</httpModules>

Please anybody help me?

Thank you

RAMON ROCHA
from Brazil
 
R

Ramon Rocha

My mistake was used
Dim strSID As String = Session.SessionID
.... before Sub Page_Load
The session info is not available when the class System.Web.UI.Page.... is
created

Sub Page_Load(...
Dim strSID As String = Session.SessionID

It's works!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top