Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 275519 - Last Review: May 8, 2001 - Revision: 1.0
PRB: Global.asa Reports "Element Not Found" Error
This article was previously published under Q275519
When you use the Active Server Pages (ASP)
Request.ServerVariables collection in the Application events defined in the Global.asa file, you may receive the following error message:
(0x8002802B)
Element not found.
global.asa, line xx
NOTE: In the error message above,
xx varies depending on how the code has been written.
The
Request.ServerVariables collection is not available in the Application events of the Global.asa file. The Application events include the
Application_OnStart and the
Application_OnEnd procedures.
To work around this issue, access the
Request.ServerVariables collection in the Session events of the Global.asa file. The Session events include the
Session_OnStart and the
Session_OnEnd procedures. To make your code run only when the application starts or ends, you can add the following code to the Global.asa file:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
Application("txtOnStart") = true
End Sub
Sub Session_OnStart
if Application("txtOnStart") = true then
Application("txtPathInfo") = Request.ServerVariables("PATH_INFO")
Application("txtInstanceId") = Request.ServerVariables("INSTANCE_ID")
Application("txtOnStart") = false
end if
End Sub
</SCRIPT>
Steps to Reproduce Behavior
To reproduce this behavior, add the following code to the Global.asa file:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
Application("txtPathInfo") = Request.ServerVariables("PATH_INFO")
End Sub
</SCRIPT>
APPLIES TO
- Microsoft Active Server Pages 4.0
| kbaspobj kbcodesnippet kbprb kbscript KB275519 |
Retired KB Content DisclaimerThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate