473,503 Members | 1,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET NameSpaces

I have created a few classes in a namespae for example Namespace
PageClassVB. However when I open up a Web page and type 'Imports
PageClassVB' the IDE shows an error as "Namespace or type
'PageClassVB' for the imports 'PageClassVB' cannnot be found". What
are the methods to refer to a namespace in another page?
Nov 18 '05 #1
4 1031
You must add a reference to the assembly in your project prior to using an
imports statement.

"Joseph Cooper" <co******@hotmail.com> wrote in message
news:42**************************@posting.google.c om...
I have created a few classes in a namespae for example Namespace
PageClassVB. However when I open up a Web page and type 'Imports
PageClassVB' the IDE shows an error as "Namespace or type
'PageClassVB' for the imports 'PageClassVB' cannnot be found". What
are the methods to refer to a namespace in another page?

Nov 18 '05 #2
In addition, there is a difference in the way that NameSpaces are handled in
an assembly, depending upon what language you use to develop. In VB.Net, the
assembly name becomes the top-level NameSpace for the assembly, while in C#,
you define the NameSpace for the assembly in the code. So, if you put a
NameSpace into a VB.Net assembly, you're actually using a NameSpace that
resides UNDER the top-level NameSpace for that assembly.

If it gets confusing, and you're using Visual Studio.Net, you can use the
Class View to see the hierarchy of NameSpaces in your assemblies.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Gary Vidal" <ga**@usballoon.net> wrote in message
news:eQ**************@TK2MSFTNGP10.phx.gbl...
You must add a reference to the assembly in your project prior to using an
imports statement.

"Joseph Cooper" <co******@hotmail.com> wrote in message
news:42**************************@posting.google.c om...
I have created a few classes in a namespae for example Namespace
PageClassVB. However when I open up a Web page and type 'Imports
PageClassVB' the IDE shows an error as "Namespace or type
'PageClassVB' for the imports 'PageClassVB' cannnot be found". What
are the methods to refer to a namespace in another page?


Nov 18 '05 #3
Let me append something to my remarks. I should have said that in VB.Net,
the DEFAULT NameSpace is the assembly name. You can change it in the Project
Properties dialog box, so that it is whatever you want it to be.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:ex**************@TK2MSFTNGP10.phx.gbl...
In addition, there is a difference in the way that NameSpaces are handled in an assembly, depending upon what language you use to develop. In VB.Net, the assembly name becomes the top-level NameSpace for the assembly, while in C#, you define the NameSpace for the assembly in the code. So, if you put a
NameSpace into a VB.Net assembly, you're actually using a NameSpace that
resides UNDER the top-level NameSpace for that assembly.

If it gets confusing, and you're using Visual Studio.Net, you can use the
Class View to see the hierarchy of NameSpaces in your assemblies.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Gary Vidal" <ga**@usballoon.net> wrote in message
news:eQ**************@TK2MSFTNGP10.phx.gbl...
You must add a reference to the assembly in your project prior to using an imports statement.

"Joseph Cooper" <co******@hotmail.com> wrote in message
news:42**************************@posting.google.c om...
I have created a few classes in a namespae for example Namespace
PageClassVB. However when I open up a Web page and type 'Imports
PageClassVB' the IDE shows an error as "Namespace or type
'PageClassVB' for the imports 'PageClassVB' cannnot be found". What
are the methods to refer to a namespace in another page?



Nov 18 '05 #4
Hi Kevin,

Thanks for the reply. Could you let me know how to create the assembly
(The class file is part of the same project) and how do I add a
reference to the assembly to the project.

Thanks
Joseph Cooper

"Kevin Spencer" <ke***@takempis.com> wrote in message news:<#B**************@TK2MSFTNGP12.phx.gbl>...
Let me append something to my remarks. I should have said that in VB.Net,
the DEFAULT NameSpace is the assembly name. You can change it in the Project
Properties dialog box, so that it is whatever you want it to be.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:ex**************@TK2MSFTNGP10.phx.gbl...
In addition, there is a difference in the way that NameSpaces are handled

in
an assembly, depending upon what language you use to develop. In VB.Net,

the
assembly name becomes the top-level NameSpace for the assembly, while in

C#,
you define the NameSpace for the assembly in the code. So, if you put a
NameSpace into a VB.Net assembly, you're actually using a NameSpace that
resides UNDER the top-level NameSpace for that assembly.

If it gets confusing, and you're using Visual Studio.Net, you can use the
Class View to see the hierarchy of NameSpaces in your assemblies.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Gary Vidal" <ga**@usballoon.net> wrote in message
news:eQ**************@TK2MSFTNGP10.phx.gbl...
You must add a reference to the assembly in your project prior to using an imports statement.

"Joseph Cooper" <co******@hotmail.com> wrote in message
news:42**************************@posting.google.c om...
> I have created a few classes in a namespae for example Namespace
> PageClassVB. However when I open up a Web page and type 'Imports
> PageClassVB' the IDE shows an error as "Namespace or type
> 'PageClassVB' for the imports 'PageClassVB' cannnot be found". What
> are the methods to refer to a namespace in another page?


Nov 18 '05 #5

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

Similar topics

18
3012
by: Steven Bethard | last post by:
In the "empty classes as c structs?" thread, we've been talking in some detail about my proposed "generic objects" PEP. Based on a number of suggestions, I'm thinking more and more that instead of...
24
3468
by: Marcin Vorbrodt | last post by:
Here is an example of my code: //Header file #include <vector> using std::vector; namespace Revelation { // class definitions, etc... // class members are of type std::vector }
2
1576
by: Mike Morse | last post by:
What see sample that show xs:element where the xs namespace = http://www.w3.org/2001/XMLSchema However, I see another example with xsi: where xsi = http://www.w3.org/2001/XMLSchema-instance ...
3
2306
by: Jim Heavey | last post by:
Trying to get the hang of Namespaces. I have primarly developed in VB and am transitioning to C# and the .Net Environment. I have worked a bit with Java as well in school about a year or so ago....
17
2053
by: clintonG | last post by:
Using 2.0 with Master Pages and a GlobalBaseClass for the content pages. I understand the easy part -- the hierarchical structure of a namespace naming convention -- but the 2.0 IDE does not...
11
1737
by: Random | last post by:
I'm confused about the proper use and usefulness of namespaces. I beleive I understand the purpose is so the developer can put classes within namespaces to essentially organize your code. And I...
0
7198
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
7271
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7319
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...
1
6979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4998
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.