I just started a new category for my blog named ASP.NET Best Practices. As I stated in another entry I'm putting together a bible of best practices for ASP.NET development. Until it's finished I'm going to be posting a new tip everyday. After it's finished I'll post the document and it will become a living document. If you have a tip respond to one of my tips and I'll add it. Now some of these tips are pretty obvious, but that is exactly why I'm keeping them in. Because they're so obvious they're often overlooked.
General Coding Tips
Use Code Regions: When using Visual Studio.NET or Visual Studio.NET 2003 you can specify code regions. Code regions are basically blocks of code that you can collapse within the Visual Studio IDE. What code regions enable you to do is group related pieces of code together which makes things easier to find. For instance, I typically will group all my properties for a class within a Properties code region.
The way you specifiy a region is a little different between C# and VB. Let's take a look:
Visual Basic .NET
#Region " P R O P E R T I E S "
Public MyProp As String
#End Region
C#
#region P R O P E R T I E S
public string MyProp;
#endregion
There are a couple rules to using Regions.
1.) Regions must have a starting and ending directive
2.) They can be nested
3.) They can't overlap other block statements