Writing conventions for ASP.NET controls

Asked

Viewed 461 times

7

When you drag a control from Toolbox to a Web Form Visual Studio automatically adds an ID to this control consisting of its type with uppercase first letter and a number.

This is the same pattern used in VB.NET projects with Windows Forms, but when you are using C# with Windows Forms Visual Studio places the first lowercase letter and the same occurs in that standard (Hungarian notation) widely used which is to abbreviate the type (eg. in C#: txt, btn, cmb, etc).

So why is it that when I’m doing an ASP.NET project using C# the default is VB.NET? Is there a writing convention for ASP.NET controls? Which is the most used by professionals in the field?

  • 1

    This standard is called "Hungarian notation". See wikipedia article (in English, the pt version is very bad), and http://support.microsoft.com/kb/173738/en-us (also in English).

  • vlw for reminding me man, I added to the question the correct name.

2 answers

8


Is there any writing convention for ASP.NET controls?

Microsoft has a writing convention for its languages.

This documentation recommends:

  • Use Pascalcasing for all public names consisting of multiple members' words, types and namespace.
  • Use camelCasing for parameter names.

0

  • 1

    Welcome to our community, the correct thing is that this space is reserved only to effective answers, the ideal is that your content is posted in comment form! ;D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.