Writing conventions for controls in ASP.NET

7

When you drag a control from the Toolbox to a Web Form, Visual Studio automatically adds an ID to this control that consists of its type with the first letter of capital and a number.

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

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

    
asked by anonymous 15.12.2013 / 02:20

2 answers

8
  

Is there any writing convention for controls in ASP.NET?

Microsoft has a writing convention for its languages.

This documentation recommends:

  
  • Use PascalCasing for all public names consisting of multiple words for members, types, and namespaces.
  •   
  • Use camelCasing for parameter names.
  •   
    
15.12.2013 / 12:00
0

Just for the sake of knowledge, there is a very interesting document developed by dotnetspider , built on the recommendations of Microsoft and community contributions. link

    
30.01.2014 / 23:42