ASP.NET – Microsoft’s Coding Standards for ASP.NET Controls

asp.netccoding-standardscoding-stylenet

I cannot find any naming standards/conventions in MSDN for naming ASP.NET controls.

One of the following standards tends to be used by programmers:

  • lblAddress
  • AddressLabel
  • Address

According to MSDN's Name of Type Members, should we be treating ASP.NET controls as fields, hence using Pascal Case (e.g. AddressLabel)?

Best Answer

I'm for your second entry, AddressLabel. For a couple reasons. One, I believe that the Hungarian Notation first one is out of favor in a big way. Next, I believe that a lot of times labels precede input fields or another chunk of text, so there could be several "Address" controls and they'll need to be disambiguated in some form. Hence, AddressLabel.

Related Topic