views:
346answers:
5It is hard to list all good practices at once. But here is a starting list.
- Always start developing your pages by disabling state management features like the view state and session. Enable them only if they are absolutely necessary.
- Know the ASP.Net page life cycle.
- Don't mix up html markup with code and javascript.
- Embed web resources like images and java script files in a .Net assembly.
For C# and .Net in general I'd highly recommend picking up Krzysztof Cwalina and Brad Adams' book "Framework Design Guidelines". That book along with running my code against FxCop and the ReSharper Code Analysis has really helped me keep my code clean and lean
Here is a decent C# standards document written by the guys at dotnetspider.
The Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries by Krzysztof Cwalina and Brad Adams is probably the best resource out there. While the book emphasizes of reusable libraries you can easily tailor the guidance to standards projects.
Brad Adams (one of the authors of the book), also blogs about many of the rules frequently.
C# and VB coding Standards Reference documents
For coding style, look at Clint Edmonson's C# and VB coding Standards Reference Documents.
Two good resoruces for ASP.NET specific guidance is the MSDN Security Guidelines: ASP.NET 2.0 and the ASP.NET Coding Standards published by the Victoria, Australia's Department of Eduction and Early Childhood Development.
Finally, SSW (another group in Australia) has a great section called SSW Rules to Better... which has all kinds of rules for different development activities.