Solved

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

Posted on 1998-09-15
5
226 Views
Last Modified: 2013-12-25
I have the following code in my globa.asa file
<script LANGUAGE="VBScript" RUNAT="Server">
SUB Session_OnStart
      Session("Count") = 10
END SUB
</script>

then in a asp file I have the following code
<html>

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

<body>

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

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

Keith
0
Comment
Question by:kjsmith3
  • 3
5 Comments
 
LVL 10

Expert Comment

by:MasseyM
ID: 1855051
Rather than using <%= Count %> use <% =Session.Count %>

0
 

Author Comment

by:kjsmith3
ID: 1855052
When trying that answer, get the following error.
0
 

Author Comment

by:kjsmith3
ID: 1855053
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 ""
0
 
LVL 28

Accepted Solution

by:
sybe earned 30 total points
ID: 1855054
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.

0
 

Author Comment

by:kjsmith3
ID: 1855055
It was in the right place, I rebuilt the machine and it seem to work.

Keith
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question