Should ASPX code-behind be within a namespace?
Something like this:
Namespace Test_NS
Partial Class Test_WebSite
Inherits System.Web.UI.Page
End Class
End Namespace
Or should I leave it alone and only keep the classes in my App_Code under a Namespace开发者_如何学JAVA?
It makes little difference for a project. By default, your code-behind is NOT in a shared name-space. Also, your classes (I assume you're still talking code-behind) are not stored in the app_code folder.
Do you use visual studio? It will do the organizing for you, and if you're not sure, then I'd just leave everything as-is.
Any new .vb files (not code-behind) that you create independently do go in the app_code folder, and you can group these in name-spaces (or not) as you wish.
精彩评论