partial class and namespace

S

Sami Rehman

Hi
I want to use namespaces to organize all the classes, web forms, and user
controls. It works fine with my user defined classes, but when I try to put
all the web pages in a namespace for example
namespace myCompany. MyApp.Web
{
}
the page starts throwing error, and rightly so because, its a partial class
public partial class _Default : System.Web.UI.Page
and the other part of it is not in the same namespace. The error message in
VS is

Error 1 Make sure that the class defined in this code file matches the
'inherits' attribute, and that it extends the correct base class

Is there anyway around this problem.

-Sami
 
G

Guest

If you right click on your project in Solution Explorer, choose Properties,
then Application, you will see where you can set the default namespace.
Peter
 
S

Sami Rehman

i have dont that for the class library projects in my solution but i dont
seem to find that defualt namespace setting option in the web site project.
when i right click on the web site, i do see a Property Pages option but it
does not have any Application selection of default namespace option in it.
 
S

Sami Rehman

Got it! Thanks.
its strange though that they dont have this feature for website projects
 

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