Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)?

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer

It's the second version, AddressLabel. However,

  1. If it's just a label, and you never refer to it in code, you can go with the default label1, label2, or whatever the IDE automatically assigns.

  2. I prefer uxAddressLabel and uxAddressTextBox. This causes intellisense to group all the controls together, and makes them much easier to refer to. This is my only remaining use for Hungarian notation.

share|improve this answer
+1 for the ux comment idea – Sam Mar 18 '13 at 22:21

Yes controls are fields of your Page class. You should name it with camel casing. Like lblResult, grdEmployees etc. If you do not have any good naming convention in your company then you can use Microsoft naming convention. You can read more about basic Microsoft naming convention here.

share|improve this answer

In programming language naming convention have great benefits to reduce the effort needed to read and understand source code. It provides better understanding in case of reuse code after a long interval of time. It is an initial step for beginner to learn any programming language. It is a very important element

A good reference regarding this:

Hope it will help you

Best regard

share|improve this answer
welcome to programmers. the question is about naming controls. so, your answers is not really addressing the question. the op is aware of the general benefit, otherwise he would not have asked the question in the first place ;-). – kr1 Mar 26 '13 at 7:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.