server side script ignored

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jopek

    server side script ignored

    pardon the simple question


    I am just getting into ASP and i am having a bit of a problem.
    If I set variables in the Application_OnS tart() in the global.asa which
    is run on the server and then I try to display or use the variables in a
    page the variables do not seem to exist.
    I get the same problem even if I run examples from the wrox ProAsp 3.0
    book.

    An example would be:

    in global.asa or within test.asp

    <% LANGUANGE="VBSc ript" runat="server" %>
    <Script>
    sub Application_onS tart()
    Application("Na me") = "test"
    end sub
    </Script>

    test.asp

    ..
    ..
    ..
    <H1> Application Name: <% = Application("Na me") %> </H>
    ..
    ..
    ..

    The only thing displayed is the "Applicatio n Name:"

    Is this a configuration problem?


    thank you for your help

    john


  • Vilmar Brazão de Oliveira

    #2
    Re: server side script ignored

    Hi,
    I use global.asa thus:
    <script language="VBScr ipt" runat="Server">
    Sub Application_OnS tart
    Application("Vi sitantesAtivos" ) = 0
    Application("To talVisitas") = 0
    End Sub

    Sub Application_OnE nd
    End Sub

    Sub Session_OnStart
    Application.Loc k
    Session.Timeout = 60 '»»60 min. = 1 h. Tempo de expiração da session padrão
    no site da hi-tec.
    Application("Vi sitantesAtivos" ) = Application("Vi sitantesAtivos" ) + 1
    Application("To talVisitas") = Application("To talVisitas") + 1
    Application.UnL ock
    End Sub

    Sub Session_OnEnd
    Application.Loc k
    Application("Vi sitantesAtivos" ) = Application("Vi sitantesAtivos" ) - 1
    Application.UnL ock
    End Sub

    </script>
    -----------------------------
    so you can write the values in any places of you asp application:
    <%=Application( "VisitantesAtiv os")%>

    bye,

    --

    Sem mais,

    ««««««««»»»»»»» »»»»»»»
    Vlmar Brazão de Oliveira
    Desenvolvimento Web
    HI-TEC

    "jopek" <jopek@aol.co m> escreveu na mensagem
    news:403613EF.3 060909@aol.com. ..[color=blue]
    > pardon the simple question
    >
    >
    > I am just getting into ASP and i am having a bit of a problem.
    > If I set variables in the Application_OnS tart() in the global.asa which
    > is run on the server and then I try to display or use the variables in a
    > page the variables do not seem to exist.
    > I get the same problem even if I run examples from the wrox ProAsp 3.0
    > book.
    >
    > An example would be:
    >
    > in global.asa or within test.asp
    >
    > <% LANGUANGE="VBSc ript" runat="server" %>
    > <Script>
    > sub Application_onS tart()
    > Application("Na me") = "test"
    > end sub
    > </Script>
    >
    > test.asp
    >
    > .
    > .
    > .
    > <H1> Application Name: <% = Application("Na me") %> </H>
    > .
    > .
    > .
    >
    > The only thing displayed is the "Applicatio n Name:"
    >
    > Is this a configuration problem?
    >
    >
    > thank you for your help
    >
    > john
    >
    >[/color]


    Comment

    • Bob Barrows [MVP]

      #3
      Re: server side script ignored

      jopek wrote:[color=blue]
      > pardon the simple question
      >
      >
      > I am just getting into ASP and i am having a bit of a problem.
      > If I set variables in the Application_OnS tart() in the global.asa
      > which is run on the server and then I try to display or use the
      > variables in a page the variables do not seem to exist.
      > I get the same problem even if I run examples from the wrox ProAsp 3.0
      > book.
      >
      > An example would be:
      >
      > in global.asa or within test.asp
      >
      > <% LANGUANGE="VBSc ript" runat="server" %>
      > <Script>
      > sub Application_onS tart()
      > Application("Na me") = "test"
      > end sub
      > </Script>[/color]

      Have you restarted the application since adding this code to the global.asa?
      Usually it's not necessary, but, it can't hurt to try.

      Bob Barrows

      --
      Microsoft MVP -- ASP/ASP.NET
      Please reply to the newsgroup. The email account listed in my From
      header is my spam trap, so I don't check it very often. You will get a
      quicker response by posting to the newsgroup.


      Comment

      • jopek

        #4
        Re: server side script ignored

        thanks for the response.
        I did try that a few times.
        This doesn't seem to make sense.

        J

        Bob Barrows [MVP] wrote:[color=blue]
        > jopek wrote:
        >[color=green]
        >>pardon the simple question
        >>
        >>
        >>I am just getting into ASP and i am having a bit of a problem.
        >>If I set variables in the Application_OnS tart() in the global.asa
        >>which is run on the server and then I try to display or use the
        >>variables in a page the variables do not seem to exist.
        >>I get the same problem even if I run examples from the wrox ProAsp 3.0
        >>book.
        >>
        >>An example would be:
        >>
        >>in global.asa or within test.asp
        >>
        >><% LANGUANGE="VBSc ript" runat="server" %>
        >><Script>
        >>sub Application_onS tart()
        >>Application(" Name") = "test"
        >>end sub
        >></Script>[/color]
        >
        >
        > Have you restarted the application since adding this code to the global.asa?
        > Usually it's not necessary, but, it can't hurt to try.
        >
        > Bob Barrows
        >[/color]

        Comment

        • jopek

          #5
          Re: server side script ignored

          Thank you for your response.

          I have almost the exact code you have and it
          still does not work!

          Strange!!!


          Vilmar Brazão de Oliveira wrote:[color=blue]
          > Hi,
          > I use global.asa thus:
          > <script language="VBScr ipt" runat="Server">
          > Sub Application_OnS tart
          > Application("Vi sitantesAtivos" ) = 0
          > Application("To talVisitas") = 0
          > End Sub
          >
          > Sub Application_OnE nd
          > End Sub
          >
          > Sub Session_OnStart
          > Application.Loc k
          > Session.Timeout = 60 '»»60 min. = 1 h. Tempo de expiração da session padrão
          > no site da hi-tec.
          > Application("Vi sitantesAtivos" ) = Application("Vi sitantesAtivos" ) + 1
          > Application("To talVisitas") = Application("To talVisitas") + 1
          > Application.UnL ock
          > End Sub
          >
          > Sub Session_OnEnd
          > Application.Loc k
          > Application("Vi sitantesAtivos" ) = Application("Vi sitantesAtivos" ) - 1
          > Application.UnL ock
          > End Sub
          >
          > </script>
          > -----------------------------
          > so you can write the values in any places of you asp application:
          > <%=Application( "VisitantesAtiv os")%>
          >
          > bye,
          >
          > --
          >
          > Sem mais,
          >
          > ««««««««»»»»»»» »»»»»»»
          > Vlmar Brazão de Oliveira
          > Desenvolvimento Web
          > HI-TEC
          >
          > "jopek" <jopek@aol.co m> escreveu na mensagem
          > news:403613EF.3 060909@aol.com. ..
          >[color=green]
          >>pardon the simple question
          >>
          >>
          >>I am just getting into ASP and i am having a bit of a problem.
          >>If I set variables in the Application_OnS tart() in the global.asa which
          >>is run on the server and then I try to display or use the variables in a
          >>page the variables do not seem to exist.
          >>I get the same problem even if I run examples from the wrox ProAsp 3.0
          >>book.
          >>
          >>An example would be:
          >>
          >>in global.asa or within test.asp
          >>
          >><% LANGUANGE="VBSc ript" runat="server" %>
          >><Script>
          >>sub Application_onS tart()
          >>Application(" Name") = "test"
          >>end sub
          >></Script>
          >>
          >>test.asp
          >>
          >>.
          >>.
          >>.
          >><H1> Application Name: <% = Application("Na me") %> </H>
          >>.
          >>.
          >>.
          >>
          >>The only thing displayed is the "Applicatio n Name:"
          >>
          >>Is this a configuration problem?
          >>
          >>
          >>thank you for your help
          >>
          >>john
          >>
          >>[/color]
          >
          >
          >[/color]

          Comment

          • Mark Schupp

            #6
            Re: server side script ignored

            Is the directory containing the global.asa file defined as an application in
            IIS (icon in IIS manager should be an activeX "ball" in a box)?

            --
            Mark Schupp
            Head of Development
            Integrity eLearning
            Advancing limitless knowledge and continual growth to create confident problem solvers, one course at a time.



            "jopek" <jopek@aol.co m> wrote in message news:403613EF.3 060909@aol.com. ..[color=blue]
            > pardon the simple question
            >
            >
            > I am just getting into ASP and i am having a bit of a problem.
            > If I set variables in the Application_OnS tart() in the global.asa which
            > is run on the server and then I try to display or use the variables in a
            > page the variables do not seem to exist.
            > I get the same problem even if I run examples from the wrox ProAsp 3.0
            > book.
            >
            > An example would be:
            >
            > in global.asa or within test.asp
            >
            > <% LANGUANGE="VBSc ript" runat="server" %>
            > <Script>
            > sub Application_onS tart()
            > Application("Na me") = "test"
            > end sub
            > </Script>
            >
            > test.asp
            >
            > .
            > .
            > .
            > <H1> Application Name: <% = Application("Na me") %> </H>
            > .
            > .
            > .
            >
            > The only thing displayed is the "Applicatio n Name:"
            >
            > Is this a configuration problem?
            >
            >
            > thank you for your help
            >
            > john
            >
            >[/color]


            Comment

            • jopek

              #7
              Re: server side script ignored

              Mark,

              thank you.
              Okay, I just realized my problem. I was trying to run the site from
              Interdev. when I run the site/app from a ie it works fine.
              So, what is the secret to getting this to work within Interdev?

              thanks again


              John

              Mark Schupp wrote:[color=blue]
              > Is the directory containing the global.asa file defined as an application in
              > IIS (icon in IIS manager should be an activeX "ball" in a box)?
              >[/color]

              Comment

              • jopek

                #8
                Re: server side script ignored - got it!!!!

                guess i had to turn on server side debugging.

                thanks again


                john

                Mark Schupp wrote:[color=blue]
                > Is the directory containing the global.asa file defined as an application in
                > IIS (icon in IIS manager should be an activeX "ball" in a box)?
                >[/color]

                Comment

                Working...