public module not accessible

  • Thread starter Thread starter Ryan McLean
  • Start date Start date
R

Ryan McLean

Hello everyone! I will describe what I am trying to accomplish, then
the problem I am having.

I am storing database passwords in the appSettings node of the
web.config file. In the Session_Start of the global.asax file I am
calling a public sub routine inside of a public module. The sub sets
a public variable (defined at the module level) to a connection
string, dependant upon the environment (dev, qa, or prd).

What I am seeing is the "global" is only accessible every other
request or so. Except it's not that consistent.

Our server administrators have us exclude the sessionState node from
the web.config. I imagine that the machine.config designated
sessionState is used in its absence.

Any ideas would be greatly appreciated.

Thanks, have a great weekend!
Ryan
 
Hi Ryan,

Are there custom connection strings for each user? If not, you'd be better
to store it in an Application variable when the Application starts. That
would make it available to all users and not depend on the Session.

Ken
MVP [ASP.NET]
 
Thanks Ken! I think shared functions/subs and application variables
are the way to go. I appreciate the help!

Ryan
 
Back
Top