Basic namespace problem

  • Thread starter Centron System Solutions
  • Start date
C

Centron System Solutions

I have a simple project created so I can get used to using namespaces.

1. I created a Web site using C#

2. I created a sub folder to the main project folder.

3. Inside the sub folder I have a file containing the following:

I have a simple namespace declared with a class inside.

namespace Data_Manager
{

public class DataBase_Manager
{

}
}

4. In my default.aspx.cs I have the following

using Data_Manager;

public partial class TabDemo : System.Web.UI.Page
{

DataBase_Manager DataBase_Manager1;

}

5. BUILD error.

This is the error I get. Im obviously missing a step.
------------------------------------------------
Error 1 The type or namespace name 'Data_Manager' could not be found
(are you missing a using directive or an assembly reference?) C:
\inetpub\wwwroot\GSM_Web_Proj_CSharp\Default.aspx.cs
-----------------------------------------------

Can someone tell me what I mst do to have default.aspx.cs see my new
namespace.



Thanks for any help in advance

Regards

Denis
 
F

Family Tree Mike

Centron System Solutions said:
I have a simple project created so I can get used to using namespaces.

1. I created a Web site using C#

2. I created a sub folder to the main project folder.

3. Inside the sub folder I have a file containing the following:

I have a simple namespace declared with a class inside.

namespace Data_Manager
{

public class DataBase_Manager
{

}
}

4. In my default.aspx.cs I have the following

using Data_Manager;

public partial class TabDemo : System.Web.UI.Page
{

DataBase_Manager DataBase_Manager1;

}

5. BUILD error.

This is the error I get. Im obviously missing a step.
------------------------------------------------
Error 1 The type or namespace name 'Data_Manager' could not be found
(are you missing a using directive or an assembly reference?) C:
\inetpub\wwwroot\GSM_Web_Proj_CSharp\Default.aspx.cs
-----------------------------------------------

Can someone tell me what I mst do to have default.aspx.cs see my new
namespace.



Thanks for any help in advance

Regards

Denis


That should work, and does work for me using VS 2008. What version of
Visual Studio are you using?

Just double checking something though... When you create a class in the new
folder, FolderOne in my case, the class that is created defaults to the
namespace WebApplication1.FolderOne. You apparently renamed the namespace
from the default that was created, correct?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top