Solved

what is the error "Active Server Pages error 'ASP 0137' "?

Posted on 2002-05-30
7
934 Views
Last Modified: 2012-08-14
Can anyone please help me what is the error about and why I get this error and how to solve it?
When i run any asp page i get the following error:
Active Server Pages error 'ASP 0137'

Invalid Global Script

//global.asa, line 1

Script blocks must be one of the allowed Global.asa procedures. Script directives within <% ... %> are not allowed within the global.asa file. The allowed procedure names are Application_OnStart, Application_OnEnd, Session_OnStart, or Session_OnEnd.

I dont know whats the problem ?can anyone tell me how i can solve the problem and make my asp page work.
Thanks.
0
Comment
Question by:shah2k
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 20

Accepted Solution

by:
jitganguly earned 50 total points
ID: 7045931
Hmmm. You global.asa file should be like this

<SCRIPT LANGUAGE=VBScript RUNAT=Server>

Sub Session _onStart
...
' Some session vars
...
End Sub
sub Application_OnStart
...
...
'Some application vars

End Sub
</SCRIPT>
0
 

Author Comment

by:shah2k
ID: 7046008
Thanks for your answer.Actually i put the global.asa script inside the script tag and hence the error.Now i have taken the tag and the file works fine.
Thanks.
0
 
LVL 33

Expert Comment

by:hongjun
ID: 7046042
That's strange. What jitganguly said is correct. Some information for you.

1. Global.asa should be placed in the root directory.
2. You should never make function calls to the 4 standard functions in the file.
3. Structure of the file is as below
<script language="VBScript" runat="Server">
Sub Session_onStart
' This will be invoked automatically when a session is started
End Sub

Sub Session_onEnd
' This will be invoked automatically when a session is abandaned/ended
End Sub

Sub Session_onStart
' This will be invoked automatically when a session is started
End Sub

Sub Application_onStart
' This will be invoked automatically when the web application is started.
End Sub

Sub Application_onEnd
' This will be invoked automatically when the web application is stopped.
End Sub
</script>
4. There shouldn't have any <%..%> in the file itself.
5. There shouldn't have any Response.Write in the file.


I suggest you post the content of the file here for view.

hongjun
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Expert Comment

by:Silvers5
ID: 7046285
post your global.asa content please
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 7046286
post your global.asa content please
0
 
LVL 20

Expert Comment

by:jitganguly
ID: 7046877
If everything works fine then why a 'B' ? Remember it is a free service and I spent some time solving your problem. Don't you appreciate it with a A grade.
Actually it was my mistake not looking at your history, I wouldn't have tried.
I will ask CS to change it to 'A'
Rgds
Jit
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question