Solved

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

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now