views:

1159

answers:

4

Currently I am developing a site with about seven partial classes, a few icons, three pages and an App_Themes folder. I was interested to know, is there an industry standard directory structure for anything larger than a small project?

For example, I want to keep the classes in separate folders, the images in separate folders etc. My current directory structure is as follows (not exact, this is from memory):

  • (root) contains the codebehind and forms
  • /App_Data
  • /App_Themes
  • /Bin
  • /Images
  • /Models - I stole the name from MVC. It sounded more appropriate then 'classes'
  • /FusionCharts - a flash charting library

I briefly played with MVC, and it looked like a nice directory structure, however, I am using ASP.NET Ajax.

So, I guess the question is, is there a way to make this directory structure more orderly in your own opinion? Please give answers as to why you made your decision also :).

+1  A: 

The only "standard" name you are missing for ASP.NET would be App_Code.

Use the convention that makes sense to you and the people that will be maintaining the code. There is no industry standard for this that I've come across in 4+ years of doing ASP.NET development.

Bryan
+1  A: 

I also follow the same structure as mentioned by you. The only additions that I make is have separate folders for scripts,CSS, and resources. As far as I am aware of there is no such industry standard.

Codeslayer
+1  A: 

I like having a Content folder under which I can put my Css, Js, and Images folders.

Kevin Pang
+1  A: 

I like to be inspired by Microsoft standards, since we are using a Microsoft technology. Plus a somewhat good standard is better than no standard, especially if you work in a larger team.

App_Code is standard of course, because it has a function in ASP.NET, not just a best practice.

I sort of like the MVC standard project's structure:

  • Content -- Contains subdirectories with Images, Css, Javascript
  • Controllers -- Maybe N/A in WebForms
  • Views -- Also maybe overkill in WebForms

The "Content" folder is maybe the key, since it's the lowest common denominator for ASP.NET projects. So if you work with both WebForms and MVC you'll feel at home in all projects, if you know you have your static resources in that folder.

Seb Nilsson