Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive.
I am using session variables fine in other parts of the program but I'm reading them after the page load.
<%@dotnet.itags.org.Import Namespace="System.data.SqlClient" %>
<%@dotnet.itags.org.Import Namespace="System.data" %>
<script runat="server">
Dim SQLCmd as string
Dim dbConn = Session("UserConnectionString")
Sub Page_Load
...
Thanks!Just set the enableSessionState to true.
If that dosen't work, just pass the conn string in to the URL, less secure though.
Thanks for the reply! I can't use a querystring in this instance and I've tried putting a PAGE directive with enablesessionstate but it didn't work. The session variable becomes available after the pageload so I think that session state is enabled.
Any more help would be greatly appreciated!
0 comments:
Post a Comment