?
Solved

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

Posted on 1998-09-15
5
Medium Priority
?
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 60 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
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 look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

752 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