partial class and namespace

  • Thread starter Thread starter Sami Rehman
  • Start date Start date
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
 
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
 
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.
 
Got it! Thanks.
its strange though that they dont have this feature for website projects
 
Back
Top