I've recently merged two classes from code-behind pages into a single
namespace definition (using c#). I then changed the page directives
in both of my aspx files to point to the same .cs file
(Src="default.aspx.cs") and both have their proper definitions to
their "working" class (Inherits="BB.BBList" and
Inherits="BB.BBSelectPage"). In my code behind, I have:
using ...
namespace BB
{
public class BBSelectPage : System.Web.UI.Page
{
...all its members...
}
public class BBList : System.Web.UI.Page
{
...all its members...
}
}
Because I use the Src page directive, the code behind compiles when I
load the aspx in IE - which works fine & the pages function. (I've
tested that it works ok by inserting/removing Response.Write text in
VS.net & reloaded the pages) The error I've been having though is
that when I try to build the BB namespace in VS.net - I get the
error "E:\archive\BB\default.aspx.cs(250): The namespace 'BB' already
contains a definition for 'BBList'"
I verified that there's only one definition of this class in the
current namespace - so I'm thinking that perhaps a previously built
dll with the old namespace definition exists - and is causing this
error.
Before I merged the 2 classes, I had two separate aspx pages pointing
to two separate code-behinds with similar namespace definitions:
+++ page1.aspx.cs +++
using ...
namespace BB
{
public class BBSelectPage : System.Web.UI.Page
{
...all its members...
}
}
+++ page2.aspx.cs +++
using ...
namespace BB
{
public class BBList : System.Web.UI.Page
{
...all its members...
}
}
The last page I've used/tested was page2.aspx. I've also checked
the /bin directory for the application & deleted the existing dll &
have restarted IIS (and VS.net) to make sure nothing was being
cached. I still get this error. Any ideas?