Solved

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

Posted on 2002-05-30
7
927 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
 
LVL 20

Expert Comment

by:jitganguly
ID: 7047241
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
rebind a grid after user clicks on node in treeview 1 52
Save ms data to server side. 19 64
Weighted Randomizing 6 38
Extracting nodes  using classical ASP 3 40
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…

734 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