how to get the Namespace of the application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello,

i used in all classes of the app_code files a individual Namespace, for
example
Namespace MyApp1Namespace
........

How can i get programmatically the name of this Namespace.

best regards
 
Not sure if this is what you're asking for, but given an instance of a
class, you can get the Type and then the namespace, ala:

User user = new User();
user.GetType().Namespace

Karl
 
I think what he wants is how to figure out the namespace of the current
project... I been trying to figure that out myself. In asp.net 1.1 all we
had to do is open up a codebehind file or select the project from the
solution explorer and click the properties button in the solution explorer.
The window showed a property called "default namespace" which gave us the
namespace of the project.

How do we do this in asp.net 2.0 using c#?
 
i don't think there is a default namespace...

every time I create a new class file, I wrap a namespace xx { } around it
:\

Karl
 
Hello Karl, thanks - exact this is what i looked for,

best regards
Xavier
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top