473,715 Members | 2,163 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 2484
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
3821
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
2006
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
2227
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. 3. When we have to run gacutil.exe file. Whenever we
0
1537
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 the CLR is installed. But don't I want to establish just one global assembly cache on say one of our...
2
2975
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 with VB.Net. So here goes. 1 All of the books I have accessed do basic one-two form examples...
6
3003
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 = Player() game.loadPlayer(player) player.moveTo(location)
14
2060
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 connection and use it for all the queries? Also, if I'm using a preparedstatement and resultset for a...
8
2860
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
1523
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 concerned about the lifetime of a thread in the case of smtp errors, and how it will work with...
0
8817
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9322
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9193
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9092
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9037
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7963
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5964
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4472
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2531
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.