Where is the namespace in 2005?

In ASP.NET using C#, I am not able to add a namespace to my pages. When I do I get a bunch of errors. Here is what I am doing:

namespace MyNamespace
{

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

protected void Page_Load(object sender, EventArgs e)
{}

}
}

Could this be because this is a partial class

In VS 2003 I was able to change the namespace, I could also specify a default namespace, but I have been unable to find a way to do this in 2005. Can anyone give me a hint



Answer this question

Where is the namespace in 2005?

  • Ken huang

    Not so sure about the namespace, have you tried it without using the partial keyword  

    and the Default namespace is now called the root namespace, you can find it if you right click your project, go to properties, then Application.

  • Kaligero

    I think in ASP.net namespaces should reflects a directory heirarchy,, in other words if you want to put some code in a namespace MySpace you should create a folder called MySpace and put the classes in it like Java does...

    if you made this from VS.net it will be made automatically.. try to create a folder in the solution explorer then Create a class in that folder, you will find that VS created a namespace with name same as the folder name and added the class in it...

     



  • Where is the namespace in 2005?