Solved

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

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

Accepted Solution

by:
jitganguly earned 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 20

Expert Comment

by:Silvers5
Comment Utility
post your global.asa content please
0
 
LVL 20

Expert Comment

by:Silvers5
Comment Utility
post your global.asa content please
0
 
LVL 20

Expert Comment

by:jitganguly
Comment Utility
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
Comment Utility
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now