Call a subroutine/function in Global.asa from an ASP page?

Posted by Don Zacharias on Stack Overflow See other posts from Stack Overflow or by Don Zacharias
Published on 2010-06-14T21:44:43Z Indexed on 2010/06/14 22:42 UTC
Read the original article Hit count: 251

Filed under:
|

Hi all, In Classic ASP, shouldn't a subroutine in global.asa be available to all .asp pages in the session? For some reason I am having trouble calling the sub. Before I look at whether something specific to my application is causing the problem I wanted to make sure I understood properly.

global.asa:

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
  sub foo
    session("foo") = true
  end sub
</SCRIPT>

myinclude.inc, included in all pages:

call foo

I get 'Type Mismatch' runtime error referencing foo. Am I totally misunderstanding this?

© Stack Overflow or respective owner

Related posts about asp-classic

Related posts about vbscript