Still using namespaces in 2.0 with VS2005 pages?

C

clintonG

Are developers still using namespaces in their code for pages or is this
practice no longer neccessary for pages? I don't see the rationale here.
except perhaps for controls that are comprised of compiled assemblies with
methods and properties that may cause conflicts with other classes.

What is your current practice for 2.0 development when using VS2005?

<%= Clinton Gallagher
 
G

Guest

You are free to choose whether you want a custom namespace or not. If you do
not set one, ASP.NET constructs a default "ASP" namespace for you. For
example:

namespace ASP
{
[CompilerGlobalScope]
public class default_aspx : _Default, IHttpHandler
{
// Methods
public default_aspx();
private HtmlHead __BuildControl__control2();
private HtmlTitle __BuildControl__control3();
private HtmlForm __BuildControlform1();
private void __BuildControlTree(default_aspx __ctrl);
protected override void FrameworkInitialize();
public override int GetTypeHashCode();
public override void ProcessRequest(HttpContext context);

// Fields
private static object __fileDependencies;
private static bool __initialized;
}
}
 
C

clintonG

Thank you for your comments Peter but hasn't the use of namespaces become
superfluous in pages? Once used somewhere seems they must be used
throughout. For example I used a namespace in each partial class of a page.
Then discovered when calling a utility class it should be appended with my
custom namespace to avoid an exception.

// Example namespace used in page partial class
namespace CompanyName
{
public partial class ControlPanel : GlobalBaseClass
{
// raises exception
BuildChannel rss = new BuildChannel( );

// no problem
CompanyName.BuildChannel rss = new CompanyName.BuildChannel( );
}

}

Is this usage correct? If so, that makes me wonder to what end the namespace
is useful in general as it does not appear to be needed. I haven't found any
really really in-depth documentation which speaks to all of the concerns one
might have regarding this topic.

<%= Clinton Gallagher



Peter Bromberg said:
You are free to choose whether you want a custom namespace or not. If you
do
not set one, ASP.NET constructs a default "ASP" namespace for you. For
example:

namespace ASP
{
[CompilerGlobalScope]
public class default_aspx : _Default, IHttpHandler
{
// Methods
public default_aspx();
private HtmlHead __BuildControl__control2();
private HtmlTitle __BuildControl__control3();
private HtmlForm __BuildControlform1();
private void __BuildControlTree(default_aspx __ctrl);
protected override void FrameworkInitialize();
public override int GetTypeHashCode();
public override void ProcessRequest(HttpContext context);

// Fields
private static object __fileDependencies;
private static bool __initialized;
}
}


--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




clintonG said:
Are developers still using namespaces in their code for pages or is this
practice no longer neccessary for pages? I don't see the rationale here.
except perhaps for controls that are comprised of compiled assemblies
with
methods and properties that may cause conflicts with other classes.

What is your current practice for 2.0 development when using VS2005?

<%= Clinton Gallagher
 

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