Variable naming rules in ASP. NET

Source: Internet
Author: User

The variable name length should be only for the compiler, and the memory address is used for the final operation ~ It should not affect the performance, so we should try to make the variable name simple and easy to understand when writing the program; the variable name naming rules are actually to help understand and facilitate later maintenance. Do not covet the convenience of writing code, and make changes at last confused. However, if the variable name is too long, it is better to add a comment behind it.
Below I will write the variable naming rules commonly used in ASP. NET:

Variable naming rules:
Array ---- arr
Boolean ---- bln
Byte ----- byt
Char ----- chr
Datetime ----- dtm
Decimal ----- dec
Double ----- dbl
Integer ----- int
Long ----- lng
Object ----- obj
Short ------ shr
Single ----- sng
String ----- str

WebControls control command rules:
Cdrotator ----- adrt
Button ----- btn
Calendar ----- cal
Checkbox ----- chk
Checkboxlist ----- chkl
Comparevalidator ----- valc
Customvalidator ----- valx
Datagrid ----- dgrd
Datalist ----- dlst
Dropdownlist ----- drop
Hyperlink ----- lnk
Image ----- img
Imagebutton ----- ibtn
Label ----- LBL
Linkbutton ----- lbtn
ListBox ----- lst
Panel ----- pnl
Placeholder ----- plh
Radiobutton ----- Rad
Radiobuttonlist ----- RADL
Rangevalidator ----- valg
Regularexpression ----- vale
Validator ----- valv
Repeater ----- RPT
Requiredfieldvalidator ----- valr
Table ----- TBL
Tablecell ----- tblc
Tablerow ----- tblr
Textbox ----- txt
Validationsummary ----- Vals
XML ----- xmlc

Sqlclient naming rules:
Connection ----- con
Command ----- cmd
Parameter ----- parm
Dataadapter ----- dad (ADAP)
Datareader ----- dtr
Dataset ----- dst
Datatable ----- dtbl
Datarow ----- drow
Datacolumn ----- dcol
Datarelation ----- drel
Dataview ----- dvw
DataGridView ------ grdvw (dgrdvw)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.