Click to See Complete Forum and Search --> : Multiple Namespaces


gav_will
September 27th, 2002, 10:24 AM
I'm sure there is a simple answer to this question but I don't know it.

If you create a webservice called service it puts the directory service in the web root and \bin inside of that.

If I put a aspx file in the root it will not work however if I put in in the \service directory it will work. So far this hasn't been a problem I just put the file in the directory. However now I have come across a situation where I need to use two namespaces lets say I need an aspx file in service to use a namespace in ..\servicetwo.

Is it possible to does this. Is there a simple way such as the way you Import the namespace in the aspx file instead of me having to jig all the files around and change all the other files that call them?

MRutledge
September 27th, 2002, 05:50 PM
at the top of your aspx page use a import directive

<%@ Import NameSpace="thenameSpacetoImport" %>

and thats it....then in your code behind page you can either write out the fully qualified name like:

thenameSpacetoImport.ClassName var;

or you can use the using directive

using thenameSpacetoImport;

ClassName var;

Matt