473,587 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Basic Questions about Global.asa from a beginner

I am learning classic ASP 3.0. Below are my questions:

1. Do we have to include (<!-- #include FILE="global.as a" -->) the
global.asa file into every .asp page? I am doing the examples in
Windows Notepad and not in DreamWeaver or InterDev. Or, does IIS
automatically associate global.asa, if one is present in the
application folder, with the pages in that folder?

2. Can we write other global functions that we intend to use accross
pages in an application in the global.asa file? I have done so but when
I call the method in a login.asp page, I get a TypeMismatch.

For e.g in login.asp

<%
Response.Write( CallMe())
Response.End
%>

In global.asa

Sub Application_onS tart()
End Sub
....
.....etc. (application and session events)

Public Function CallMe()
CallMe = "Did you just call me?"
End Sub

Sep 17 '06 #1
1 2475
wrote on 17 sep 2006 in microsoft.publi c.inetserver.as p.general:
I am learning classic ASP 3.0. Below are my questions:

1. Do we have to include (<!-- #include FILE="global.as a" -->)
No, it wouldn't even run.
the
global.asa file into every .asp page? I am doing the examples in
Windows Notepad and not in DreamWeaver or InterDev.
Very good, using a text editor is the best way to learn ASP, HTML and
other code.
Or, does IIS
automatically associate global.asa, if one is present in the
application folder, with the pages in that folder?
No.

global.asa runs only when the ASP application starts, restarts, or when
the apication sees that it is changed.

So global.asa does not run at the beginning of a session!

However session_nstart is invoked at every session start.
2. Can we write other global functions that we intend to use accross
pages in an application in the global.asa file?
No, global.asa only lets you set application variables and session
variables.
I have done so but when
I call the method in a login.asp page, I get a TypeMismatch.

For e.g in login.asp

<%
Response.Write( CallMe())
unnecesary () if you use vbscript.
Response.End
%>

In global.asa

Sub Application_onS tart()
End Sub
...
....etc. (application and session events)

Public Function CallMe()
CallMe = "Did you just call me?"
End Sub
So you knew this already ;-{

Try:

Sub Application_onS tart()
application("Ca llMe") = "Did you just call me?"
End Sub

<%
Response.Write application("Ca llMe")
Response.End
%>

=============

If you want to have standard functions present on your pages,
include them:

<!-- #include virtual="/myLibrary/myFunctionsIncl ude.asp" -->

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3816
by: abisofile | last post by:
hi I'm new to programming.I've try a little BASIC so I want ask since Python is also interpreted lang if it's similar to BASIC.
15
1996
by: Pelle Beckman | last post by:
Hi all, I have a few newbie questions: In function declaration what does a 'const' mean inside the parameter list ? That it won't modify the value? void MemberFunction(const int x);
4
2219
by: Ramesh | last post by:
hi, Let me ask some basic questions. Can anybody explain me about the following questions: 1. When we have to create sn key? Whenever we compiled Component we have to create or it is a one time process? 2. What information contained in sn key. I gone through that it is having public key. How it is using this key to intract with client....
0
1533
by: Andy | last post by:
Hey All, I'm a beginner with VB.Dotnet Deployment and I'm a little confused about some very basic deployment issues . . . I've now created some core assemblies that will be used throughout all of our applications that run on various machines on our local network. I understand that the global assembly cache exists on each machine where...
2
2968
by: Fay Yocum | last post by:
BEWARE beginner questions!! I have some experience in Access but never as much as I want or need. I have decided to get in on VB.Net. I would only rate myself in Access as a Beginner/Intermediate VBA programmer. I have decided to go at learning VB.Net in a more organized manner. I have some questions where answers are not becoming clear...
6
2992
by: Qun Cao | last post by:
Hi Everyone, I am a beginner on cross language development. My problem at hand is to build a python interface for a C++ application built on top of a 3D game engine. The purpose of this python interface is providing a convenient scripting toolkit for the application. One example is that a user can write a python script like: player =...
14
2046
by: abctech | last post by:
Helo experts, I'm working on my first ever web application and I have some basic questions related to servlets if I may, I have 5-6 Java statements and preparedstatements in my servlet to execute a number of MySQL queries for different tables, do I need to open a new connection to the database for each query or can I just create one...
8
2853
by: Chris Asaipillai | last post by:
Hi there I have some questions for those experienced Visual Basic 6 programmers out there who have made the transition from VB6 to Vb.net. How long did it take you to learn at least the basic elements of VB.net....so that you were confident to write a application from scratch. This wouldnt necessarily
3
1517
by: JJ | last post by:
I've done a little multi-threading on winform apps some time ago now, so I'm not a complete beginner, but best assume I am for any explanations..: This is an asp.net 2.0 website, using c#: I have a thread whose job is to send several emails (i.e. a long task that mustn't be run by more that one user at a time). It all works fine, but I am...
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.