I am trying to refactor a classic asp code base. For the most part it is going well. It had lots of code duplication for different language versions of the site, so for 6 languages the site was replicated 5 times.
I have used json language files and have managed to make it all far more dynamic and it works lovely.
What I am trying to do now is make the Language class a global object throughout the application for ease of use.
I have used global.asa but the instructions and tutorials I find are very minimal and don't really carry anything I am understanding properly.
I have 2 files:
global.asa
<!--#include virtual="/Five/Classes/Language.asp"-->
<object runat="server" scope="session" id="Lang" progid="Language">
Lang = New Language
</object>
and test.asp
<%
Lang.LoadLanguageFile("reportAbuse")
%>
<%= Lang.iString("strTitle") %>
what happens though is I receive
Microsoft VBScript runtime error '800a01a8'
Object required: 'Lang'
/Five/0/test.asp, line 2
I cannot, having looked all around here and the web find anything more than:
GLOBAL.ASA:
<object runat="server" scope="session" id="MyAd" progid="MSWC.AdRotator">
</object>
You could reference the object "MyAd" from any page in the ASP application:
SOME .ASP FILE:
<%=MyAd.GetAdvertisement("/banners/adrot.txt")%>