Winform/webform/asp.net control naming conventions for Visual Studio C #

Source: Internet
Author: User

Control naming conventions

Type Prefix Example
AdRotator Adrt Adrttopad
Button Btn Btnsubmit
Calendar Cal Calmettingdates
CheckBox Chk Chkblue
CheckBoxList Chkl Chklfavcolors
CompareValidator Valc Valcvalidage
CustomValidator Valx Valxdbcheck
Datagrid Dgrd Dgrdtitles
DataList Dlst Dlsttitles
DropDownList Ddl Ddlcountries
HyperLink Lnk Lnkdetails
Image Img Imgauntbetty
ImageButton Ibtn Ibtnsubmit
Label LbL Lblresults
LinkButton Lbtn Lbtnsubmit
ListBox Lst Lstcountries
Panel PnL PnlForm2
PlaceHolder Plh Plhformcontents
RadioButton Rad Radfemale
RadioButtonList Radl Radlgender
RangeValidator Valg Valgage
RegularExpression Vale Valeemail_validator
Repeater Rpt Rptqueryresults
RequiredFieldValidator Valr Valrfirstname
Table Tbl Tblcountrycodes
TableCell Tblc Tblcgermany
TableRow Tblr Tblrcountry
Textbox Txt txtFirstName
ValidationSummary Vals Valsformerrors
Xml Xmlc Xmlctransformresults

Ado. NET control naming conventions

dcolproductid /tr> /tr>
type prefix example
connection< /td> con connorthwind
Command cmd cmdreturnproducts
Parameter parm parmproductid
DataAdapter dad dadproducts
DataReader dtr dtrproducts
DataS Et DST dstnorthwind
DataTable dtbl dtblproduct
DataRow drow drowRow98
DataColumn dcol
DataRelation drel drelmasterdetail
D Ataview dvw dvwfilteredproducts

Variable Naming conventions

Type Prefix Example
Array Arr Arrshoppinglist
Boolean bln Blnispostback
Byte Byt Bytpixelvalue
Char Chr Chrdelimiter
Datetime Dtm Dtmstartdate
Decimal Dec Decaverageheight
Double Dbl Dblsizeofuniverse
Integer Int Introwcounter
Long Lng Lngbillgatesincome
Object Obj Objreturnvalue
Short Shr Shraverage
Single Sng Sngmaximum
String Str strFirstName

-----------------------------

Control Name

Shorthand

Control Name

Shorthand

Web Forms
Label

LbL

Textbox

Tb

Button

Btn

LinkButton

Lb

HyperLink

hl

Repeator

Tp2

ImageButton

Ib

DropDownList

Ddl

ListBox

Lb

Datagrid

Dg

DataList

Dl

CheckBox

Cb

CheckBoxList

Cbl

RadioButton

Rb

RadioButtonList

Rbl

Image

Img

Panel

PnL

Calender

Cld

AdRotator

Ar

Table

Tbl

PlaceHolder

Ph

Xml

Xml

RequiredFieldValidator

Rfv

CompareValidator

Cv

RangeValidator

Rv

RegularExpressionValidator

Rev

Validatorsummary

Vs

CustomValidation

Cv

Literal

Ltl

Treeview

Tv

Data
DataSet

Ds

DataTable

Dt

DataView

Dv

SqlConnection

Sc

SqlDataAdapter

Sda

SqlCommand

Sc

Html
Label

LbL

Button

Btn

Reset Button

Rb

Submit Button

Sb

Text Field

Tf

Text Area

Tr

File Field

Ff

Password Field

Pf

Checkbox

Cb

Radio Button

Rb

Hidden

Hdn

Table

Tbl

Flow Layout Panel

Flp

Grid Layout Panel

Glp

Image

Img

Listbox

Lb

Abbreviations for common words
Argument

Arg

Maximum

Max

Buffer

Buf

Message

Msg

Clear

Clr

Minimum

Min

Clock

Class

Multiplex

Mux

Compare

Cmp

Operating System

OS

Configuration

Cfg

Overflow

Ovf

Context

Ctx

Parameter

Param

Delay

Dly

Pointer

Ptr

Device

Dev

Previous

Prev

Disable

Dis

Priority

Prio

Display

Disp

Read

Rd

Enable

En

Ready

Rdy

Error

Err

Register

Reg

Function

Fnct

Schedule

Sched

Hexadecimal

Hex

Semaphore

Sem

High priority Task

HPT

Stack

Stk

I/O System

Ios

Synchronize

Sync

Initialize

Init

Timer

Tmr

Mailbox

Mbox

Trigger

Trig

Manager

Mgr

Write

Wr

Some of the anti-semantic phrases commonly used in software

Add/remove

Begin/end

Create/destroy

Insert/delete

First/last

Get/release

Increment/decrement

Put/get

Add/delete

Lock/unlock

Open/close

Min/max

Old/new

Start/stop

Next/previous

Source/target

Show/hide

Send/receive

Source/destination

Cut/paste

Up/down

Winform/webform/asp.net control naming conventions for Visual Studio C #

Related Article

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.