I have 3 files containing classes, let's say - A, B and C. B and C both contain the file A as they are subclasses of A, using the "#include file " directive. I am facing a problem if a page contains both B and C, it is saying 'Class A: name redefined'.

This is obviously happening because both B & C have copies of A, and they are clashing. Is there a way to specify to include only one copy of a file for an ASP page ? Something like the 'require_once' directive of PHP ?

Hi,
I understood that you have 3 files, which contain some identical data. If you redefine classes, then you get an error. There is no need to have copies of classes, if you wish to include all three files. You should only have copies of the classes, when you include only one file.

Good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.