Best Practices for ASP.NET Webforms Project structure

Viewed 7605

When using ASP.NET webforms, I see two main ways to structure a project:

1) Have a lot of .aspx files (including code behind files) and maybe some .ascx files (with code behind files.

2) Rely on a lot of .cs files (class files), and have the classes construct everything with Controls.Add(), etc.

The first method above results in a lot of aspx and ascx files and very few .cs files. The second method above results in a lot of .cs files, but very fewer aspx and ascx files.

Is there a "best practices" way to structure project? Does Microsoft recommend one of these techniques? Is there any information on which of the two styles is used more commonly?

4 Answers
Related