Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2002-05-30
7
Medium Priority
?
957 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 200 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 20

Expert Comment

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

Expert Comment

by:Michel Sakr
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

916 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