I have a file, MyClass.asp. This file defines the class MyClass, and some functions within that class.
MyClass.asp is included in the file IncludeA.asp, and also in the file IncludeB.asp. IncludeA.asp is itself included in various files on the site, as is IncludeB.asp.
The problem is, there is one file that includes BOTH IncludeA.asp AND IncludeB.asp, causing a "Name redefined" error since both of these includes are trying to define MyClass.
The only way around this I've been able to figure out is to remove the MyClass.asp include from IncludeB.asp, and but I'm not happy with that solution as it requires me to remember that any time I include IncludeB.asp but not IncludeA.asp, I need to include MyClass.asp as well. Is there a better solution? Perhaps a way to modify MyClass.asp so it checks to see if the class has already been defined before defining it again?