Global.asa not firing

Discussion in 'ASP General' started by qaz, Jan 23, 2005.

  1. qaz

    qaz Guest

    For some reason my global.asa file is not firing. I have it located in the
    root of my website (e.g., wwwroot\mywebsite\global.asa) and I have the web
    site configured as an "application" in IIS. When I modified the file I also
    stopped and restarted the web server.

    Can anyone give me some ideas as to why it is not firing?

    Thanks
     
    qaz, Jan 23, 2005
    #1
    1. Advertising

  2. Well, what evidence do you have thatit is not firing? What method is the
    "not firing" occuring in? What is the code in that method?

    Have you seen http://www.aspfaq.com/2076 and http://www.aspfaq.com/2078 ?

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "qaz" <> wrote in message
    news:...
    > For some reason my global.asa file is not firing. I have it located in

    the
    > root of my website (e.g., wwwroot\mywebsite\global.asa) and I have the

    web
    > site configured as an "application" in IIS. When I modified the file I

    also
    > stopped and restarted the web server.
    >
    > Can anyone give me some ideas as to why it is not firing?
    >
    > Thanks
    >
    >
     
    Aaron [SQL Server MVP], Jan 23, 2005
    #2
    1. Advertising

  3. qaz

    qaz Guest

    My evidence is pretty good. In Application_OnStart I created an application
    variable named Application("test") and set it equal to "Application". In
    Session_OnStart I set a session variable called session("test") = "Session".
    I put response.write statements in test.asp and fired the page.


    "Aaron [SQL Server MVP]" <> wrote in message
    news:%...
    > Well, what evidence do you have thatit is not firing? What method is the
    > "not firing" occuring in? What is the code in that method?
    >
    > Have you seen http://www.aspfaq.com/2076 and http://www.aspfaq.com/2078 ?
    >
    > --
    > http://www.aspfaq.com/
    > (Reverse address to reply.)
    >
    >
    >
    >
    > "qaz" <> wrote in message
    > news:...
    > > For some reason my global.asa file is not firing. I have it located in

    > the
    > > root of my website (e.g., wwwroot\mywebsite\global.asa) and I have the

    > web
    > > site configured as an "application" in IIS. When I modified the file I

    > also
    > > stopped and restarted the web server.
    > >
    > > Can anyone give me some ideas as to why it is not firing?
    > >
    > > Thanks
    > >
    > >

    >
    >
     
    qaz, Jan 23, 2005
    #3
  4. qaz

    Lance Wynn Guest

    Make sure mywebsite is setup as an application, and not a subdirectory of
    the parent web. If it is a subdirectory, the root global.asa will fire
    instead.

    "qaz" <> wrote in message
    news:...
    For some reason my global.asa file is not firing. I have it located in the
    root of my website (e.g., wwwroot\mywebsite\global.asa) and I have the web
    site configured as an "application" in IIS. When I modified the file I also
    stopped and restarted the web server.

    Can anyone give me some ideas as to why it is not firing?

    Thanks
     
    Lance Wynn, Jan 23, 2005
    #4
  5. Make sure session cookies are enabled in your browser - Tools, Internet
    Options, Privacy, Advanced, check the box "Always allow session cookies"

    If you are using IE 5.5 or IE 6.0, and your local server name has an
    underscore or other non-alphanumeric character (other than a dash) in the
    name, then cookies will not work correctly. One workaround is to access the
    machine by IP address; others include renaming the server or at least adding
    an entry to the clients' hosts files, or alter your local DNS/WINS, or add a
    new host header to the web server, with a more friendly name. For more info,
    search http://msdn.microsoft.com/ for Q312461 and Q316112.

    Make sure you haven't disabled session state in Internet Services Manager,
    and that it has an appropriate timeout value:
    Open the Internet Services Manager MMC tool, and expand 'Web Sites'
    Right-click 'Default Web Site' or the application in question, and select
    'Properties'
    On the 'Home Directory' tab, click the 'Configuration...' button
    On the 'Options' tab, make sure 'Enable session state' is checked and that
    the timeout value (in minutes) is sufficient.


    Also, try removing and re-creating the application in the Internet Services
    Manager MMC tool. this often fixes problems like this.



    --
    John Blessing

    http://www.LbeHelpdesk.com - Help Desk software priced to suit all
    businesses
    http://www.room-booking-software.com - Schedule rooms & equipment bookings
    for your meeting/class over the web.
    http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
    "qaz" <> wrote in message
    news:...
    > My evidence is pretty good. In Application_OnStart I created an
    > application
    > variable named Application("test") and set it equal to "Application". In
    > Session_OnStart I set a session variable called session("test") =
    > "Session".
    > I put response.write statements in test.asp and fired the page.
    >
    >
    > "Aaron [SQL Server MVP]" <> wrote in message
    > news:%...
    >> Well, what evidence do you have thatit is not firing? What method is the
    >> "not firing" occuring in? What is the code in that method?
    >>
    >> Have you seen http://www.aspfaq.com/2076 and http://www.aspfaq.com/2078 ?
    >>
    >> --
    >> http://www.aspfaq.com/
    >> (Reverse address to reply.)
    >>
    >>
    >>
    >>
    >> "qaz" <> wrote in message
    >> news:...
    >> > For some reason my global.asa file is not firing. I have it located in

    >> the
    >> > root of my website (e.g., wwwroot\mywebsite\global.asa) and I have the

    >> web
    >> > site configured as an "application" in IIS. When I modified the file I

    >> also
    >> > stopped and restarted the web server.
    >> >
    >> > Can anyone give me some ideas as to why it is not firing?
    >> >
    >> > Thanks
    >> >
    >> >

    >>
    >>

    >
    >
     
    John Blessing, Jan 23, 2005
    #5
  6. qaz

    Evertjan. Guest

    John Blessing wrote on 23 jan 2005 in
    microsoft.public.inetserver.asp.general:

    > Make sure session cookies are enabled in your browser - Tools, Internet
    > Options, Privacy, Advanced, check the box "Always allow session cookies"


    This has nothing to do with:

    response.write application("started")

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Jan 23, 2005
    #6
  7. qaz

    qaz Guest

    Sorry, I don't know what you are talking about. What is
    application("started")?


    "Evertjan." <> wrote in message
    news:Xns95E776C94FDBeejj99@194.109.133.29...
    > John Blessing wrote on 23 jan 2005 in
    > microsoft.public.inetserver.asp.general:
    >
    > > Make sure session cookies are enabled in your browser - Tools, Internet
    > > Options, Privacy, Advanced, check the box "Always allow session cookies"

    >
    > This has nothing to do with:
    >
    > response.write application("started")
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Replace all crosses with dots in my emailaddress)
    >
     
    qaz, Jan 23, 2005
    #7
  8. qaz

    qaz Guest

    Very helpful response - unfortunately I still have the problem. Session
    cookies are enabled in the browser (I use them successfully on other pages);
    I have no "funny" characters in the local server name; Session State is
    enabled in internet services manager and timeout is 20 min; I deleted the
    website in IIS (v6) and recreated it. Ugh! It still does not fire
    global.asa.

    Below is a complete copy of my global.asa file, if that would help:


    <SCRIPT LANGUAGE=VBScript RUNAT=Server>
    '=======================================================================
    Sub Application_OnStart

    Application.Lock
    Application("CurrentUsers") = 0
    Application("test") = "Application"
    Application.Unlock

    End Sub
    '=======================================================================
    Sub Session_OnStart

    Application("CurrentUsers") = Application("CurrentUsers") + 1

    session("test") = "Session"

    session("IDUser") = 0

    '--- force all users to begin on home page ---
    response.redirect "default.asp"
    End Sub
    '===========================================================================
    ====
    Sub Session_OnEnd
    Application("CurrentUsers") = Application("CurrentUsers") - 1
    End Sub
    '===========================================================================
    ====
    Sub Application_OnEnd

    End Sub
    </SCRIPT>








    "John Blessing" <> wrote in message
    news:...
    >
    > Make sure session cookies are enabled in your browser - Tools, Internet
    > Options, Privacy, Advanced, check the box "Always allow session cookies"
    >
    > If you are using IE 5.5 or IE 6.0, and your local server name has an
    > underscore or other non-alphanumeric character (other than a dash) in the
    > name, then cookies will not work correctly. One workaround is to access

    the
    > machine by IP address; others include renaming the server or at least

    adding
    > an entry to the clients' hosts files, or alter your local DNS/WINS, or add

    a
    > new host header to the web server, with a more friendly name. For more

    info,
    > search http://msdn.microsoft.com/ for Q312461 and Q316112.
    >
    > Make sure you haven't disabled session state in Internet Services Manager,
    > and that it has an appropriate timeout value:
    > Open the Internet Services Manager MMC tool, and expand 'Web Sites'
    > Right-click 'Default Web Site' or the application in question, and select
    > 'Properties'
    > On the 'Home Directory' tab, click the 'Configuration...' button
    > On the 'Options' tab, make sure 'Enable session state' is checked and that
    > the timeout value (in minutes) is sufficient.
    >
    >
    > Also, try removing and re-creating the application in the Internet

    Services
    > Manager MMC tool. this often fixes problems like this.
    >
    >
    >
    > --
    > John Blessing
    >
    > http://www.LbeHelpdesk.com - Help Desk software priced to suit all
    > businesses
    > http://www.room-booking-software.com - Schedule rooms & equipment bookings
    > for your meeting/class over the web.
    > http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
    > "qaz" <> wrote in message
    > news:...
    > > My evidence is pretty good. In Application_OnStart I created an
    > > application
    > > variable named Application("test") and set it equal to "Application".

    In
    > > Session_OnStart I set a session variable called session("test") =
    > > "Session".
    > > I put response.write statements in test.asp and fired the page.
    > >
    > >
    > > "Aaron [SQL Server MVP]" <> wrote in message
    > > news:%...
    > >> Well, what evidence do you have thatit is not firing? What method is

    the
    > >> "not firing" occuring in? What is the code in that method?
    > >>
    > >> Have you seen http://www.aspfaq.com/2076 and http://www.aspfaq.com/2078

    ?
    > >>
    > >> --
    > >> http://www.aspfaq.com/
    > >> (Reverse address to reply.)
    > >>
    > >>
    > >>
    > >>
    > >> "qaz" <> wrote in message
    > >> news:...
    > >> > For some reason my global.asa file is not firing. I have it located

    in
    > >> the
    > >> > root of my website (e.g., wwwroot\mywebsite\global.asa) and I have

    the
    > >> web
    > >> > site configured as an "application" in IIS. When I modified the file

    I
    > >> also
    > >> > stopped and restarted the web server.
    > >> >
    > >> > Can anyone give me some ideas as to why it is not firing?
    > >> >
    > >> > Thanks
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
     
    qaz, Jan 23, 2005
    #8
  9. Wow, this content looks familiar. If you're going to post others' content
    as if it were your own, you would show much more respect if you either cite
    the source, or take the time to put it into your own words.

    http://www.aspfaq.com/2157

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "John Blessing" <> wrote in message
    news:...
    >
    > Make sure session cookies are enabled in your browser - Tools, Internet
    > Options, Privacy, Advanced, check the box "Always allow session cookies"
    >
    > If you are using IE 5.5 or IE 6.0, and your local server name has an
    > underscore or other non-alphanumeric character (other than a dash) in the
    > name, then cookies will not work correctly. One workaround is to access

    the
    > machine by IP address; others include renaming the server or at least

    adding
    > an entry to the clients' hosts files, or alter your local DNS/WINS, or add

    a
    > new host header to the web server, with a more friendly name. For more

    info,
    > search http://msdn.microsoft.com/ for Q312461 and Q316112.
    >
    > Make sure you haven't disabled session state in Internet Services Manager,
    > and that it has an appropriate timeout value:
    > Open the Internet Services Manager MMC tool, and expand 'Web Sites'
    > Right-click 'Default Web Site' or the application in question, and select
    > 'Properties'
    > On the 'Home Directory' tab, click the 'Configuration...' button
    > On the 'Options' tab, make sure 'Enable session state' is checked and that
    > the timeout value (in minutes) is sufficient.
    >
    >
    > Also, try removing and re-creating the application in the Internet

    Services
    > Manager MMC tool. this often fixes problems like this.
     
    Aaron [SQL Server MVP], Jan 23, 2005
    #9
  10. Hi

    My apologies, I have bunch of faq stuff in a macro file, I hadn't realised
    it came from aspfaq originally. . Sometimes the users I deal with don't
    have internet access and so it is best to give them the answer directly.


    --
    John Blessing
    "Aaron [SQL Server MVP]" <> wrote in message
    news:e$o%...
    > Wow, this content looks familiar. If you're going to post others' content
    > as if it were your own, you would show much more respect if you either
    > cite
    > the source, or take the time to put it into your own words.
    >
    > http://www.aspfaq.com/2157
    >
    > --
    > http://www.aspfaq.com/
    > (Reverse address to reply.)
    >
    >
    >
    >
    > "John Blessing" <> wrote in message
    > news:...
    >>
    >> Make sure session cookies are enabled in your browser - Tools, Internet
    >> Options, Privacy, Advanced, check the box "Always allow session cookies"
    >>
    >> If you are using IE 5.5 or IE 6.0, and your local server name has an
    >> underscore or other non-alphanumeric character (other than a dash) in the
    >> name, then cookies will not work correctly. One workaround is to access

    > the
    >> machine by IP address; others include renaming the server or at least

    > adding
    >> an entry to the clients' hosts files, or alter your local DNS/WINS, or
    >> add

    > a
    >> new host header to the web server, with a more friendly name. For more

    > info,
    >> search http://msdn.microsoft.com/ for Q312461 and Q316112.
    >>
    >> Make sure you haven't disabled session state in Internet Services
    >> Manager,
    >> and that it has an appropriate timeout value:
    >> Open the Internet Services Manager MMC tool, and expand 'Web Sites'
    >> Right-click 'Default Web Site' or the application in question, and select
    >> 'Properties'
    >> On the 'Home Directory' tab, click the 'Configuration...' button
    >> On the 'Options' tab, make sure 'Enable session state' is checked and
    >> that
    >> the timeout value (in minutes) is sufficient.
    >>
    >>
    >> Also, try removing and re-creating the application in the Internet

    > Services
    >> Manager MMC tool. this often fixes problems like this.

    >
    >
     
    John Blessing, Jan 23, 2005
    #10
  11. qaz

    Evertjan. Guest

    qaz wrote on 23 jan 2005 in microsoft.public.inetserver.asp.general:
    > "Evertjan." <> wrote in message
    >> John Blessing wrote on 23 jan 2005 in
    >>
    >> > Make sure session cookies are enabled in your browser - Tools,
    >> > Internet Options, Privacy, Advanced, check the box "Always allow
    >> > session cookies"

    >>
    >> This has nothing to do with:
    >>
    >> response.write application("started")
    >>


    [please do not toppost on usenet]

    > Sorry, I don't know what you are talking about. What is
    > application("started")?



    Any application variable you defined and filled in global.asa:

    Sub Application_OnStart
    Application("myTest") = "Yes Sir"
    End Sub


    Can be shown in a file test.asp like this:

    <%
    Response.Write Application("myTest")
    %>

    Isrrespective of if the browser suppordt session variables.
    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Jan 23, 2005
    #11
  12. qaz

    qaz Guest

    It is setup as an application and it is not in a subdirectory of a parent.

    Any other suggestions?


    "Lance Wynn" <> wrote in message
    news:%232$...
    > Make sure mywebsite is setup as an application, and not a subdirectory of
    > the parent web. If it is a subdirectory, the root global.asa will fire
    > instead.
    >
    > "qaz" <> wrote in message
    > news:...
    > For some reason my global.asa file is not firing. I have it located in

    the
    > root of my website (e.g., wwwroot\mywebsite\global.asa) and I have the

    web
    > site configured as an "application" in IIS. When I modified the file I

    also
    > stopped and restarted the web server.
    >
    > Can anyone give me some ideas as to why it is not firing?
    >
    > Thanks
    >
    >
    >
     
    qaz, Jan 23, 2005
    #12
  13. qaz

    Terri Morton Guest

    Check the error log for the IIS server for clues.

    Try commenting out the response.redirect in the Session_OnStart to see if
    that makes a difference.

    Try removing the Session_OnStart and Session_OnEnd and then testing your
    Application variables.


    Terri Morton
    MVP - ASP/ASP.NET

    "qaz" <> wrote in message
    news:e5C%...
    > It is setup as an application and it is not in a subdirectory of a parent.
    >
    > Any other suggestions?
    >
     
    Terri Morton, Jan 24, 2005
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wayne
    Replies:
    2
    Views:
    475
    Wayne
    Nov 11, 2003
  2. Guest

    global.asa not execute

    Guest, Nov 7, 2003, in forum: ASP General
    Replies:
    3
    Views:
    131
    James Bond
    Nov 7, 2003
  3. George Hester

    global.asa is not working

    George Hester, Feb 1, 2004, in forum: ASP General
    Replies:
    3
    Views:
    247
    Bob Barrows
    Feb 1, 2004
  4. Jigar Mehta

    Hi, my global.asa is not being called..

    Jigar Mehta, Dec 11, 2005, in forum: ASP General
    Replies:
    2
    Views:
    114
  5. Rahul
    Replies:
    7
    Views:
    128
    Anthony Jones
    May 11, 2006
Loading...

Share This Page