1

enter image description hereI have created below WebBasePage class in my Web Application with Visual Studio 2013 (first time in VS2013).

namespace WebApp1.WebUI
{
    public class WebBasePage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}

When I tried to derive above base class in one of my web page (as shown below)...

namespace WebApp1.Errors 
{
    public partial class Error : WebApp1.WebUI.WebBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}

I get the following error at below line:

Line: "public partial class Error : WebApp1.WebUI.WebBasePage"

Error: The type or namespace name 'WebUI' does not exist in the namespace 'WebApp1' (are you missing an assembly reference?)

This code has been working in VS2012, not sure what's wrong with VS2013.

14
  • Is there a class and folder named WebUI in the same project? Also all your projects are having same .NET version? Commented Dec 29, 2014 at 4:13
  • There is no WebUI folder. WebBasePage class is inside App_Code folder with WebApp1.WebUI as namespace. The Web App is using .NET 4.5 and is the only project I have in this solution. Not sure if StackOverflow has attachment ability, if so I can attach this solution. Commented Dec 29, 2014 at 15:12
  • Check the references in that case. Also, you can use imgur to upload screenshot Commented Dec 29, 2014 at 15:27
  • Here is the link to the solution, zipped and shared on my google drive - WebApp1 Commented Dec 29, 2014 at 15:29
  • 1
    why do you have a sub namespace WebUI in the first place? The WebApp1 namespace seems to imply you're already in a "WebUI" environment. I know this isn't an answer, but maybe you should go a little less heavy on the namespaces. Commented Dec 29, 2014 at 15:41

1 Answer 1

2

Ensure that the "build action" in the properties pane on the problematic file is set to "Compile". Otherwise Visual Studio will not build the file and won't see the namespace or types defined in that file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.