HStrix
asked on
Using an external namespace (C# class)
Hello Experts,
I'm trying to use a C# class defined in an extra file aaa.cs inside several other bbb.asmx.cs files.
aaa.cs contains global functions.
I expect that it is related to using, alias and namespace.
But I didn't find a good and easy sample to understand that.
Thank you HStrix
I'm trying to use a C# class defined in an extra file aaa.cs inside several other bbb.asmx.cs files.
aaa.cs contains global functions.
I expect that it is related to using, alias and namespace.
But I didn't find a good and easy sample to understand that.
Thank you HStrix
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
in that case the class is in the default namespace and should be accessable without a using statement
just make sure you include aaa.cs in your project.
ASKER
aaa.cs (has class myglob) is now part of the project.
If I'm trying to use the method 'inaaa' in aaa.cs,
I'm getting the message that the method 'inaaa' does not exist in the class or namespace of myproject.bbb.
The project has as members bbb.aspx with code behind bbb.aspx.cs (has namespace myproject and class bbb).
If I'm trying to use the method 'inaaa' in aaa.cs,
I'm getting the message that the method 'inaaa' does not exist in the class or namespace of myproject.bbb.
The project has as members bbb.aspx with code behind bbb.aspx.cs (has namespace myproject and class bbb).
ASKER
I got it to work.
ASKER
what do I need to do in the case that aaa.cs does not contain a namespace information.
It only contains a class statment 'public class myglob inherits page'.