473,387 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to get the Namespace of the application

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
Feb 14 '06 #1
4 1057
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

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Xavier" <Xa****@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
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

Feb 14 '06 #2
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#?

"Karl Seguin [MVP]" wrote:
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

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Xavier" <Xa****@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
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


Feb 14 '06 #3
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
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Nuno" <Nu**@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com...
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#?

"Karl Seguin [MVP]" wrote:
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

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Xavier" <Xa****@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
> 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


Feb 14 '06 #4
Hello Karl, thanks - exact this is what i looked for,

best regards
Xavier

"Karl Seguin [MVP]" wrote:
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

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Xavier" <Xa****@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
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


Feb 14 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Christian Christmann | last post by:
Hi, are there any drawbacks using "using namespace std" instead of defining the required namespaces like using std::cout
5
by: Dave Slinn | last post by:
Any advice on how to organize my core class library project into sub-namespaces? What are the general rules of thumb regarding cross-namespace references? Can I have a class in namespace A have a...
5
by: SenthilSS | last post by:
My application produces XML Data files which have XML namespace qualified XML elements (nodes), but the namespace itself is not declared in the data file. My task is to read these data files in a...
2
by: Steve Richter | last post by:
I have a simple project that builds ok in Visual Web Developer, but which fails when I navigate to it at //localhost. The error is "namespace 'ac' could not be found". the problem page is at...
6
by: ryan.d.rembaum | last post by:
Hello, I have code that I wish to use in many web applications. Basically sort of stand utility stuff. So from Visual Studio Project I select add a component and chose Component Class. Lets...
2
by: Jeff Brown | last post by:
Hi, I suspect that this isn't possible, but I figured I'd ask. My project has a root namespace, let's say it's "Root", that applies to almost every source file (which is why I've set it as the...
2
by: Rich | last post by:
Greetings, I am trying to find a way to use a form of GetObject in VB.Net and have been researching WMI. Apparently, this is a vast subject, but seems to reference a Namespace called...
0
by: Charles Leonard | last post by:
I need opinions regarding Web Service Namespace usage and/or suggestions regarding how to handle deployment. Our web service application will exist in two different domains and is likely to...
4
by: Ruslan | last post by:
Hi, I have 3 projects: 1. Common 2. Desktop
1
by: peeping_t | last post by:
I´m currently writing an application that will have some plugin functionality and therefor I´ve created two projects one that will build the exe and one that contains the "framework" for the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.