Link to home
Start Free TrialLog in
Avatar of HStrix
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

ASKER CERTIFIED SOLUTION
Avatar of kpkp
kpkp
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HStrix
HStrix

ASKER

OK so far,
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'.
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.
Avatar of HStrix

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).

Avatar of HStrix

ASKER

I got it to work.