ASP .NET Control Naming Conventions
Control Name | Example | Prefix |
Label | lblName | lbl |
TextBox | txtName | txt |
GridView | gvResult | gv |
Button | btnSave | btn |
ImageButton | ibtnSave | ibtn |
Hyperlink | lnkHomePage | lnk |
DropDownList | ddlCompany | ddl |
ListBox | lstCompany | lst |
DataList | dlstAddress | dlst |
Repeater | repSection | rep |
Checkbox | chkMailList | chk |
CheckBoxList | chkAddress | chk |
RadioButton | rdoSex | rdo |
RadioButtonList | rdoAgeGroup | rdo |
Image | imgLogo | img |
Panel | panSection | pan |
PlaceHolder | plhHeader | plh |
Calender | calMyDate | cal |
Adrotator | adrBanner | adr |
Table | tblResults | tbl |
[All]Validators | valCreditCardNumber | val |
ValidationSummary | valsErrors | vals |
3 comments:
I prefer:
LabelName, TextBoxName, ButtonSave, ListBoxCompany, RadioButtonSex, ...
Why make your own and other people's (programming) life more complicated (and miserable) by using a slew of hard to remember and hard to decipher prefixes?
Kind regards,
Don Delegate
Dear,
Thank you for comment.
Every time when we go to write entier control name it consume time. Standards are not mandatory for every body. But some people don't follow any standard naming conventions and in industry it become tedious to understand the code. (especially in team). Standards given by me are well known in industry. And with little typing practice easy to remember.
These standards are known as Hungarian Notations in IT industry. Many IT companies follow these standards. Even in MSDN these standard prefix are given for some controls.
Regards.
Kuldeep.
It's good to summarize the controls naming convention.
But What's the naming convention for ASP.NET 3.5 should use? Like FileUpload ETC...
Post a Comment