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
Solved

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

Posted on 1998-09-15
5
232 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

856 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