473,480 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Namespace Problem

I have two class which wroten in C#, they are Company and Address, and I
want define they are under a same namespace, I found a lot but not much
resource talking about it, i tried following method

// Company.cs
using System;

namespace Project1.Domain.Company {
public class Company {
public Company() {}
}
}

// Address.cs
using System;

namespace Project1.Domain.Address {
public class Address {
public Address() {}
}
}

And in my aspx page, I need
<%@ import namespace="Project1.Domain.Company" %>
<%@ import namespace="Project1.Domain.Address" %>

but cannot like follow
<%@ import namespace="Project1.Domain.*" %>

Any solution? Is that I need place the two class in a file like follow?
using System;

namespace Project1.Domain {
public class Company {
public Company() {}
}

public class Address {
public Address() {}
}
}

Thanks
Jan 2 '06 #1
2 1570
// Company.cs
using System;
namespace Project1.Domain{
public class Company {}
}

// Address.cs
using System;

namespace Project1.Domain{
public class Address {}
}

--
Daniel Fisher(lennybacon)
http://www.lennybacon.com
"ºa¤Ö" <ºa¤Ö@¼ö¶l.¤½¥q> wrote in message
news:O1**************@TK2MSFTNGP14.phx.gbl...
I have two class which wroten in C#, they are Company and Address, and I
want define they are under a same namespace, I found a lot but not much
resource talking about it, i tried following method

// Company.cs
using System;

namespace Project1.Domain.Company {
public class Company {
public Company() {}
}
}

// Address.cs
using System;

namespace Project1.Domain.Address {
public class Address {
public Address() {}
}
}

And in my aspx page, I need
<%@ import namespace="Project1.Domain.Company" %>
<%@ import namespace="Project1.Domain.Address" %>

but cannot like follow
<%@ import namespace="Project1.Domain.*" %>

Any solution? Is that I need place the two class in a file like follow?
using System;

namespace Project1.Domain {
public class Company {
public Company() {}
}

public class Address {
public Address() {}
}
}

Thanks

Jan 2 '06 #2
problems solved
^.^

"Daniel Fisher(lennybacon)" <in**@lennybacon.com> wrote in message
news:eY*************@TK2MSFTNGP15.phx.gbl...
// Company.cs
using System;
namespace Project1.Domain{
public class Company {}
}

// Address.cs
using System;

namespace Project1.Domain{
public class Address {}
}

--
Daniel Fisher(lennybacon)
http://www.lennybacon.com
"ºa¤Ö" <ºa¤Ö@¼ö¶l.¤½¥q> wrote in message
news:O1**************@TK2MSFTNGP14.phx.gbl...
I have two class which wroten in C#, they are Company and Address, and I
want define they are under a same namespace, I found a lot but not much
resource talking about it, i tried following method

// Company.cs
using System;

namespace Project1.Domain.Company {
public class Company {
public Company() {}
}
}

// Address.cs
using System;

namespace Project1.Domain.Address {
public class Address {
public Address() {}
}
}

And in my aspx page, I need
<%@ import namespace="Project1.Domain.Company" %>
<%@ import namespace="Project1.Domain.Address" %>

but cannot like follow
<%@ import namespace="Project1.Domain.*" %>

Any solution? Is that I need place the two class in a file like follow?
using System;

namespace Project1.Domain {
public class Company {
public Company() {}
}

public class Address {
public Address() {}
}
}

Thanks


Jan 3 '06 #3

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

Similar topics

8
1903
by: Marcin Kalicinski | last post by:
Is the code below ill formed (because operator >> is defined in different namespace than class B)? It fails with VS 2005 Beta. I don't know if I should redesign my code or if I should find a...
7
7415
by: Kevin Newman | last post by:
I've been toying with a namespace manager, and wanted to get some input. So what do you think? if (typeof com == 'undefined') var com = {}; if (!com.unFocus) com.unFocus = {}; ...
5
10017
by: Alexis | last post by:
Hello, I have a set of classes I created from schema files using the xsd.exe tool. I'm using namespaces in the clases ( I had to because I have some classes with the same name but not the same...
0
2776
by: richwangler | last post by:
This problem should be easily reproducable if anybody has the time. I need to build the following XML programatically and decided to use the XMLSerializer. I simplified the XML (myExample.xml)...
5
2444
by: Mike Oliszewski | last post by:
Given the following c# code: namespace Company2 { public class SomeFunctions { public void FunctionA() { // Do Something. }
10
6627
by: anders | last post by:
I have 2 external assemblies A1 and A2 that both define class X in the global namespace. I need to use both assemblies in my VB project but the names X are ambiguous. How can I get around this...
4
3069
by: Kevin Newman | last post by:
The primary problem I've had with php is the lack of namespaces, which makes OOP very difficult to organize, since you end up with large number of classes cluttering up the same namespace - which...
30
4058
by: Pep | last post by:
Is it best to include the code "using namespace std;" in the source or should each keyword in the std namespace be qualified by the namespace tag, such as std::cout << "using std namespace" <<...
3
2918
by: George | last post by:
I am currently developing an xbrl validation software that takes an xml instance file and a lot of schemas(xsd files) and validates it against the xsd files. I am using Visual basic in visual...
7
2942
by: Armin Zingler | last post by:
Hi all, I have a Form called "Main": Public Class Main Private Sub Button1_Click( _ ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles Button1.Click
0
7055
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
6920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7059
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,...
1
6758
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
5362
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
4799
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
3011
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
1311
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 ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.