6

I've recently been given a website written in classic asp to configure and set up - although it also appears to have pages written in asp.net.

The problem I'm having at the moment is that it doesn;t appear to be picking up settings from the global.asa file such as Application("ConnectionString")....

As when I try to write them out from somewhere in the code - nothing appears.

Any idea how to congure this website to use global.asa...or why it's not already using it?

There is web.config file and global.asax...shouldn't this just be for .net?

The code will not compile in visual studio.

thegunner
  • 6,883
  • 30
  • 94
  • 143
  • 1
    web.config and global.asax are asp.net files. The global.asa (iirc) is for classic asp. Which files are you having problems reading which files? The asp.net files (aspx) won't read the values from the global.asa file. The classic asp (asp) won't read the values from the web.config or global.asax files. – Jim W Sep 15 '09 at 15:33
  • Hi, it's 99.99 written in classic asp. just noticed global.asax and web.config so guessed some of it was written in .net. It's really just global.asa that I'm not able to read the values from. – thegunner Sep 15 '09 at 16:37
  • I can't think of a reason why Global.asa would be overlooked, hence you need to show us some code from .asa and show us how you conclude the application values are not available. – AnthonyWJones Sep 16 '09 at 07:34

4 Answers4

14

I've seen this problem when the application directory is not set up in IIS with an application name. You can change that from the IIS manager.

Luke
  • 176
  • 1
  • 4
  • +1 this helped me quite a bit. I am running IIS 6. I ended up converting my virtual directory to an application at that point it ended up picking up my global.asa file. That was only after I reviewed all my odbc connections and a thousand other settings. – Bill Blankenship Nov 05 '12 at 22:12
  • almost 10 years later, it continues to work in IIS 8.5 and higher. there is no longer a field for the application name in the basic properties, just convert the directory to an application and assign it any valid application pool. – Cee McSharpface Jan 16 '18 at 22:43
1

long the lines of what Luke pointed out already:

Check that you are placing the global.asa file in the root of the web Site/Virtual Directory that your application is running from.

feihtthief
  • 6,403
  • 6
  • 30
  • 29
0

All excellent advice so far. Otherwise, it's difficult to mix-and-match classic asp and .Net.

There's some good baseline info at http://www.w3schools.com/ASP/asp_globalasa.asp.

Bob
  • 1
0

What type of file are you trying to read the values from global.asa in? An ASP page or ASPNET page?

As Jim W said, the values in global.asa will not be available in aspx pages, and vice-versa.

Also, keep in mind the subroutines in global.asa will not fire until an ASP page is requested and global.aspx routines will not fire until an ASPNET page is requested.

Joe King
  • 66
  • 4