Newbie - 2 classes in the same namespace problem

J

Jarma

I'm new to VS2005, but have experience with previous versions.
I created web site with a page and a web user control inserted in it.
Their classes are in the same namespace.

Here's the code fragment:

namespace NmSp
{
public partial class Test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}


namespace NmSp
{
public partial class wuc : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
NmSp.Test t = (NmSp.Test)Page; // <------
}
}
}

Why do I get compile time error that Test does not exitst in namespace NmSp?

Wojtek
 

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