What are the naming guidelines for ASP.NET controls?

后端 未结 18 1931
离开以前
离开以前 2020-12-07 21:23

We are in the process of nutting out the design guidelines we would like to use in our development team and got into a discussion today around how ASP.NET controls should be

18条回答
  •  一生所求
    2020-12-07 21:57

    Not sure about Microsoft official standards, but this is what i've done through out my development career.

    I generally abbreviate the control type in front of the the name of what the control does. I keep the abbreviation lower case and the control's name CamelCase.

    E.g. A texbox for username becomes tbUserName

    Here is a list of standard abbreviations I use:

    Abbr     -  Control
    
    btn  -  Button
    cb   -  CheckBox
    cbl  -  CheckBoxList
    dd   -  DropDownList
    gv   -  GridView
    hl   -  Hyperlink
    img  -  Image
    ib   -  ImageButton
    lbl  -  Label
    lbtn -  LinkButton
    lb   -  ListBox
    lit  -  Literal
    pnl  -  Panel
    ph   -  PlaceHolder
    rb   -  RadioButton
    rbl  -  RadioButtonList
    txt  -  Textbox
    

提交回复
热议问题