473,387 Members | 1,785 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.

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 1568
// 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
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
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
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
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
by: Mike Oliszewski | last post by:
Given the following c# code: namespace Company2 { public class SomeFunctions { public void FunctionA() { // Do Something. }
10
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
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
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
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
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
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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
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
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.