Results 1 to 8 of 8

Thread: global.asa

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    UK
    Posts
    164
    Okay I havent used Global.asa before and am having trouble getting it to do anything!

    I know that the global.asa file should be put in the root directory of the site.

    Here is the script I am using:

    <script language=vbscript runat=server>
    Sub Session_OnStart()
    application("test")="works okay"
    End Sub
    </script>

    And then to see if it works I try something like

    <%= application("test")%>

    I am testing this on PWS not IIS will it only work on IIS?

    Any help would be appreciated,

    Alex
    ASP, SQL, VB6, Java Script and dubious guitar playing skills.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    UK
    Posts
    164
    Thanks for the reply Bios I changed the directory properties to what you said unfortunely I still cant get it to work.

    Here is the location of the filed:

    inetpub/wwwroot/testglobal/global.asa

    The other files to testing global.asa are also in this directory.

    I bought a new computer recently and when I installed PWS it installed something it called Personal Web Manager (which looks exactly the same as PWS Im sure it was called PWS originally through - is there a difference?)

    Is my script wrong? If some one could give me a sample global.asa file to test that would be cool.

    Thanks,

    Alex
    ASP, SQL, VB6, Java Script and dubious guitar playing skills.

  3. #3
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    Try this:

    Code:
    <script language="VBScript" runat="Server"> 
    Sub Session_OnStart() 
        application("test")="works okay" 
    End Sub 
    </script>
    Last edited by Shafee; Feb 18th, 2001 at 07:51 AM.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    UK
    Posts
    164
    I added a virtual directory to PWS that refered to my testing directory. When you refer to the directory by its alias rather than its actual name it works.
    I guess the server docent recognise the scripting options or something(?) or are directory options not inherited to sub directories ?

    Thanks,

    Alex
    ASP, SQL, VB6, Java Script and dubious guitar playing skills.

  5. #5
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    I'm afraid that I don't understand what you are asking. Could you elaborate on that? Are you creating a sub directory in the web-shared directory?

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    UK
    Posts
    164
    Sorry Im not explaing well.. I have created several physical directories in inetpub/wwwroot for the different sites I work on. I thought if I gave Inetpub permissions to run scripts then other directories below in the hierarchy would inherit its properties. But it seems you have to make each directory a virtual directory and set properties on it.

    Thanks,

    Alex
    ASP, SQL, VB6, Java Script and dubious guitar playing skills.

  7. #7
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    I didn't come across that problem before. I think the others will inherit the properties of the parent directory. Let me check.

  8. #8
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    Yep. You are right. Guess we have to make a virtual directory and set its properties. All this time I thought that the sub directory inherits the properties of the parent directory. Thanks alexmac.
    Last edited by Shafee; Feb 18th, 2001 at 03:24 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width