Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2002-05-30
7
Medium Priority
?
943 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 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
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!

 
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

715 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