Problem with namespace

J

John Boy

Hi I have a ASP.NET Solution with two projects.

Project 2 has a reference to Project1

Project 1 contains a folder with path 'ctrlContacts\Address\. Under
this path is a Class called AddressView with namespace
ctrlContacts.Address. This class starts as follows:

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace ctrlContacts.Address {

/// <summary>
/// Creates controls for viewing an address object
/// </summary>
[Designer(typeof(ctrlContacts.Address.Designers.AddressViewDesigner)),
ToolboxData("<{0}:AddressView runat=server></{0}:AddressView>")]
public class AddressView : System.Web.UI.WebControls.WebControl,
INamingContainer {

// class applied to each label
private ControlViewStyle _CSSStyle = new ControlViewStyle();


Project 2 that uses this Class starts as follows:

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using gg.electricity.WebControls;
using gg.electricity.StandardSharedLibrary;

namespace controls.servicecable {

/// <summary>
/// Creates controls for viewing an address object
/// </summary>
[Designer(typeof(controls.servicecable.Designers.ServiceCableViewDesigner)),
ToolboxData("<{0}:ServiceCableView
runat=server></{0}:ServiceCableView>")]
public class ServiceCableView : System.Web.UI.WebControls.WebControl,
INamingContainer {

// class applied to each label
private ControlViewStyle _CSSStyle = new ControlViewStyle();
private ControlViewStyle _CSSAddressStyle = new
ControlViewStyle();
private DataSummaryStyle _CSSServiceCableDetailsSummaryStyle = new
DataSummaryStyle();

// controls for displaying the address
private Label lblServiceNumber;
private ctrlContacts.Address.AddressView _Address;


The last line is the line that references Project 2 and has an error:


C:\Inetpub\wwwroot\dotNet\Applications\ServicesAndMeters\controls\servicecable\ServiceCableView.cs(24):
The type or namespace name 'ctrlContacts' could not be found (are you
missing a using directive or an assembly reference?)

Even if I right click on AddressView of this line and look at the
Declaration it does take me to the correct function. Why then does .Net
say it can't find it????

Your help would be much appreciated.

Thanks,

John Guilbert.
 

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

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,076
Latest member
OrderKetoBeez

Latest Threads

Top