Defining a Session varible in the globa.asa file (easy)

I have the following code in my globa.asa file
<script LANGUAGE="VBScript" RUNAT="Server">
SUB Session_OnStart
      Session("Count") = 10

then in a asp file I have the following code

<title>Ags Processor</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
      Count = Session("Count")


<p>Processing Graph [ <%= Count %> ] </p>

I preview the asp file in a browser, and instead of count being 10, it "".  Help.

Who is Participating?
sybeConnect With a Mentor Commented:
i think the problem might be that your global.asa is not valid. That can happen when it is not in the right location. The global.asa should be in the root of your application, which is in the root of the virtual directory you have created for your application.

Rather than using <%= Count %> use <% =Session.Count %>

kjsmith3Author Commented:
When trying that answer, get the following error.
kjsmith3Author Commented:
When trying that answer got following error.
Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'Session.Count'

/cmnhome/AgsProcessor.asp, line 13
I believe you where suggesting this
<% Session("Count") %> which again return ""
kjsmith3Author Commented:
It was in the right place, I rebuilt the machine and it seem to work.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.