大家都知道写程序应该有个好的命名规范,为了工作方便,贴出来。
1 ADO.NET 命名规范
1 ADO.NET 命名规范
数据类型
|
数据类型简写
|
标准命名举例
|
Connection
|
con
|
conNorthwind
|
Command
|
cmd
|
cmdReturnProducts
|
Parameter
|
parm
|
parmProductID
|
DataAdapter
|
dad
|
dadProducts
|
DataReader
|
dtr
|
dtrProducts
|
DataSet
|
dst
|
dstNorthWind
|
DataTable
|
dtbl
|
dtblProduct
|
DataRow
|
drow
|
drowRow98
|
DataColumn
|
dcol
|
dcolProductID
|
DataRelation
|
drel
|
drelMasterDetail
|
DataView
|
dvw
|
dvwFilteredProducts
|
2 WinForm Control
命名规范
数据类型
|
数据类型简写
|
标准命名举例
|
Label
|
lbl
|
lblMessage
|
LinkLabel
|
llbl
|
llblToday
|
Button
|
btn
|
btnSave
|
TextBox
|
txt
|
txtName
|
MainMenu
|
mmnu
|
mmnuFile
|
CheckBox
|
chk
|
chkStock
|
RadioButton
|
rbtn
|
rbtnSelected
|
GroupBox
|
gbx
|
gbxMain
|
PictureBox
|
pic
|
picImage
|
Panel
|
pnl
|
pnlBody
|
DataGrid
|
dgrd
|
dgrdView
|
ListBox
|
lst
|
lstProducts
|
CheckedListBox
|
clst
|
clstChecked
|
ComboBox
|
cbo
|
cboMenu
|
ListView
|
lvw
|
lvwBrowser
|
TreeView
|
tvw
|
tvwType
|
TabControl
|
tctl
|
tctlSelected
|
DateTimePicker
|
dtp
|
dtpStartDate
|
HscrollBar
|
hsb
|
hsbImage
|
VscrollBar
|
vsb
|
vsbImage
|
Timer
|
tmr
|
tmrCount
|
ImageList
|
ilst
|
ilstImage
|
ToolBar
|
tlb
|
tlbManage
|
StatusBar
|
stb
|
stbFootPrint
|
OpenFileDialog
|
odlg
|
odlgFile
|
SaveFileDialog
|
sdlg
|
sdlgSave
|
FoldBrowserDialog
|
fbdlg
|
fgdlgBrowser
|
FontDialog
|
fdlg
|
fdlgFoot
|
ColorDialog
|
cdlg
|
cdlgColor
|
PrintDialog
|
pdlg
|
pdlgPrint
|
3 WebControl
命名规范
数据类型
|
数据类型简写
|
标准命名举例
|
AdRotator
|
adrt
|
Example
|
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
|
drop
|
dropCountries
|
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
|
一、
命名规则和风格
1.
类和方法采用
Pascal
风格
命名
。
public class SomeClass
{
const int DefaultSize = 100;
public SomeMethod()
{}
}
2.
局部变量和方法参数采用
Camel
风格
命名。
int number;
void MyMethod(int someNumber)
{}
3.
接口采用
I
作为前缀命名。
interface IMyInterface
{..}
4.
私有成员变量采用
m_
作为前缀命名,使用
Pascal
命名风格并在名称前面加上
m_
。
public class SomeClass
{
private int m_Number;
}
5.
自定义属性类型以
Attribute
作为后缀命名。
6.
自定义异常类型以
Exception
作为后缀命名。
7.
采用动词
-
宾语对命名方法,例如
ShowDialog()
。
8.
有返回值的方法的命名应该能够描述其返回值,例如
GetObjectState()
。
9.
采用描述性的变量名。
a)
避免采用单字母的变量名,如
i
或
t
;而是采用
index
或
temp
。
b)
对
public
和
protected
成员避免采用用匈牙利命名法。
c)
不要采用缩写(例如将
number
缩写为
num
)。
10.
总是使用
C#
预定义的类型,而不是使用
System
命名空间中的别名。
例如:采用
object
不用
Object
,
采用
string
不用
String,
采用
int
不用
Int32
。
11.
对于泛型,类型采用大写字母。当处理
.NET
类型的
Type
时保留其后缀
Type
。
//
正确方法:
public class LinkedList<K,T>
{……}
//
避免使用:
public class LinkedList<KeyType,DataType>
{……}
12.
采用有意义的命名空间名,例如产品名称或公司名称。
13.
避免使用类的全称,而是采用
using
声明。
14.
避免在命名空间内使用
using
语句。
1 .
利用
Pascal
的方式定义类型、方法名和常量
public class SomeClass { const int DefaultSize=100; public SomeMethod() { } } |
2.
对于局部变量和方法的参数使用骆驼命名法
int number;
void MyMethod(int someNumber)
{}
|
3.
接口的名称前加上
I
interface ImyInterface
{…}
|
4.
在私有成员变量前面加上
m_
。对于
m_
后面的变量名使用骆驼命名方法
public class SomeClass
{
private int m_Number;
}
|
5.
对自定义的属性类加上后缀
Attribute
6.
对自定义的异常类加上后缀
Exception
7.
方法的命名使用动词
----
对象对,例如
ShowDialog()
8.
有返回值的方法的命名中要有返回值的描述,例如
GetObjectState()
9.
使用带有说明性的变量名
a)
避免单字符的变量名,例如
I
或
t
等。使用类似于
index
或
temp
这样有意义的名字。
b)
对于
public
或
protected
类型的变量避免使用匈牙利表示法。
c)
不要缩写单词(例如用
num
取代
number
)。
10
.总是使用
C#
预定义而不要使用
System
名称空间中的别名,例如:
使用
object
而不是
Object
使用
string
而不是
String
使用
int
而不是
int32
//
正确
public class LinkedList<K,T>
{…}
//
避免
public class LinkedList<KeyType,DataType>
{….}
|
12.
使用有意义的名字定义名称空间,例如产品名或者公司名
13.
避免通过全限定方式使用类型名称,使用
using
关键字。
14.
避免在一个名称空间中使用
using
关键字
15.
把所有系统框架提供的名称空间组织到一起,把第三方提供的名称空间放到系统名称空间的下面
using System;
using System.Collection.Generic;
using System.ComponentModel;
using System.Data;
using MyCompany;
using MyControls;
|
16.
使用代理推导而不要显式的实例化一个化代理(
C#2.0
新特性)
delegate void SomeDelegate();
public void SomeMethod()
{…}
SomeDelegate someDelegate=SomeMethod;
|
17.
维护严格的代码缩进。不要使用
tabs
或非标准的缩进,例如一个空格。推荐的缩进是
3
到
4
个空格。
18.
在和你的代码缩进处于同一个级别处为该行代码添加注释。
19.
所有的注释都应该通过拼写检查。注释中的错误拼写意味着开发进度的延缓。
20.
所有的类成员变量应该被声明在类的顶部,并用一个空行把它们和方法以及属性的声明区分开
public class MyClass
{
int m_Number;
string m_Name;
public void SomeMethod1();
public void SomeMethod2();
}
|
21.
在最靠近一个局部变量被使用的地方声明该局部变量。
22.
一个文件名应该能够反映它所对应的类名
23.
当使用一个部分类并把该类分布到不同的文件中时,在每一个文件名末尾都加上该文件实现的部分在类整体中扮演的作用。例如
:
// In MyClass.cs
public partial class MyClass
{…}
//In MyClass.Designer.cs
public partial class MyClass
{…}
|
24.
总是要把花括号
“{”
放在新的一行
编码实践
:
1.
避免在同一个文件中放置多个类
2.
一个文件应该只向在一个名称空间内定义类型。避免在一个文件中使用多个名称空间
3.
避免在一个文件内写多于
500
行的代码(机器自动生成的代码除外)
4.
避免写超过
25
行代码的方法
5.
避免写超过
5
个参数的方法。如果要传递多个参数,使用结构。
6.
一行不要超过
80
个字符
7.
不要手动去修改任何机器生成的代码
a)
如果修改了机器生成的代码,修改你的编码方式来适应这个编码标准
b)
尽可能使用
partial classes
特性,以提高可维护性。
(C#2.0
新特性
)
8.
避免对那些很直观的内容作注释。代码本身应该能够解释其本身的含义。由可读的变量名和方法名构成的优质代码应该不需要注释。
9.
注释应该只说明操作的一些前提假设、算法的内部信息等内容。
10.
避免对方法进行注释
a)
使用充足的外部文档对
API
进行说明
b)
只有对那些其他开发者的提示信息才有必要放到方法级的注释中来
11.
除了
0
和
1
,绝对不要对数值进行硬编码,通过声明一个常量来代替该数值
12.
只对那些亘古不变的数值使用
const
关键字,例如一周的天数。
13.
避免对只读
(read-only)
的变量使用
const
关键字。在这种情况下,直接使用
readonly
关键字
public class MyClass
{
public const int DaysInWeek=7;
pubic readonly int Number;
public MyClass(int someValue)
{
Number=someValue;
}
}
|
14.
对每一个假设进行断言。平均起来,每
5
行应有一个断言。
using System.Diagnostics;
object GetObject()
{…}
object someObject=GetObject();
Debug.assert(someObject!=null);
|
15.
每一行代码都应该以白盒测试的方式进行审读。
16.
只捕捉那些你自己能够显式处理的异常。
17.
如果在
catch
语句块中需要抛出异常,则只抛出该
catch
所捕捉到的异常(或基于该异常而创建的其他异常),这样可以维护原始错误所在的堆栈位置。
catch(Exception exception)
{
MessageBox.Show(exception.Message);
throw;//
或
throw exception;
}
|
18.
避免利用返回值作为函数的错误代码。
19.
避免自定义异常类。
20.
当自定义异常类的时候:
a)
让你自定义的异常类从
Exception
类继承
b)
提供自定义的串行化机制
21.
避免在一个程序集中
(assembly)
中定义多个
Main()
方法。
22.
只把那些绝对需要的方法定义成
public,
而其它的方法定义成
internal
。
23.
避免
friend assemblies,
因为这会增加程序集之间的耦合性。
24.
避免让你的代码依赖于运行在某个特定地方的程序集。
25.
在
application assembly(EXE client assemblies)
中最小化代码量。使用类库来包含业务逻辑。
26.
避免显式指定枚举的值
//
正确
public enum Color
{
Red,Green,Blue
}
//
避免
public enum Color
{
Red=1,Green=2,Blue=3
}
|
27.
避免为枚举指定一个类型
//
避免
public enum Color:long
{
Red,Green,Blue
}
|
28.
对于
if
语句,总使用一对
{}
把下面的语句块包含起来,哪怕只有一条语句也是如此。
29.
避免使用三元条件操作符。
30.
避免利用函数返回的
Boolean
值作为条件语句。把返回值赋给一个局部变量,然后再检测。
Bool IsEverythingOK()
{…}
//
避免
if(IsEverythingOk())
{…}
//
正确
bool ok=IsEverythingOK();
if (ok)
{…}
|
31.
总是使用以零为基数的数组。
32.
总是使用一个
for
循环显式的初始化一个引用成员的数组:
public class MyClass
{}
const int ArraySize=100;
MyClass[] array=new MyClass[ArraySize];
For (int index=0;index<array.Length;index++)
{
array[index]=new MyClass();
}
|
33.
使用属性来替代
public
或
protected
类型的成员变量。
34.
不要使用继承下来的
new
操作符,使用
override
关键字覆写
new
的实现。
35.
在一个非密封(
non-sealed
)类中,总是把那些
public
和
protected
的方法定义成
virtual
。
36.
除非为了和其它语言进行互动,否则绝不要使用不安(
unsafe
)的代码。
37.
避免显示类型转换。使用
as
关键字安全的转换到另一个类型。
Dog dog=new GermanShepherd();
GermanShepherd shepherd=dog as GermanShepherd;
if (shepherd!=null)
{…}
|
38.
在调用一个代理前,总是检查它是否为
null
。
39.
不要提供
public
的事件成员变量。改用
Event Accessor
。
Public class MyPublisher
{
MyDelegate m_SomeEvent;
Public event MyDelegate SomeEvent
{
add
{
m_SomeEvent+=value;
}
remove
{
m_SomeEvent-=value;
}
}
}
|
40.
避免定义事件处理代理。使用
EventHandler<T>
或者
GenericEventHandler
。
41.
避免显示触发事件。使用
EventsHelper
安全的发布事件。
42.
总是使用接口。
43.
接口和类中方法和属性的比应该在
2:1
左右。
44.
避免只有一个成员的接口。
45.
努力保证一个接口有
3~5
个成员。
46.
不要让一个接口中成员的数量超过
20
,而
12
则是更为实际的限制。
47.
避免在接口中包含事件。
48.
当使用抽象类的时候,提供一个接口。
49.
在类继承结构中暴露接口。
50.
推荐使用显式接口实现。
51.
从来不要假设一个类型支持某个接口。在使用前总是要询问一下。
SomeType obj1;
ImyInterface obj2;
/*Some code to initialize obj1,then:*/
obj2=obj1 as ImyInterface;
if(obj2!=null)
{
obj2.Method1();
}
else
{
//Handle erro in expected interface
}
|
52.
不要硬编码向用户显示的字符串。要使用资源。
53.
不要硬编码那些可能会随发布环境变化而变化的字符串,例如数据库连接字符串。
54.
使用
String.Empty
取代
””
//
避免
string name=””;
//
正确
string name=String.Empty;
|
55.
使用一个长字符串的时候,使用
StringBuilder
代替
string
。
56.
避免在结构中提供方法
a)
参数化的构造函数是鼓励使用的
b)
可以重载运行符
57.
当声明了表态成员的时候,总是要提供一个表态构造函数。
58.
当早绑定
(early-binding)
可能的时候就尽量不要使用迟绑定(
late-binding
)。
59.
让你的应用程序支持跟踪和日志。
60.
除了要在
switch
语句块中实现代码跳转,不要使用
goto
关键字。
61.
总在
switch
语句的
default
情形提供一个断言。
int number=SomeMethod();
swith(number)
{
case 1:
trace.WriteLine(“Case 1:”)
break;
case 2:
trace.Writeline(“Case 2:”);
break;
default:
debug.Assert(false);
break;
}
|
62.
除了在一个构造函数中调用其它的构造函数之外,不要使用
this
关键字。
//Example of proper use of ‘this’
public class MyClass
{
public MyClass(string message)
{ }
public MyClass():this(“Hello”)
{ }
}
|
63.
不要使用
base
关键字访问基类的成员,除非你在调用一个基类构造函数的时候要决议一个子类的名称冲突
//Example of proper use of ‘base’
public class Dog
{
public Dog(string name)
{ }
virtual public void Bark(int howlong)
{ }
}
public class GermanShepherd:Dog
{
public GermanShepherd(string name):base(name)
{ }
override public void Bark(int howLong)
{
base.Bark(howLong)
}
}
|
64.
不要使用
GC.AddMemoryPressure()
65.
不要依赖
HandleCollector
66.
基于《
Programming .NET components
》
2/e
中第四章的内容实现
Disponse()
和
Finalize()
方法。
67.
总是在
unchecked
状态下运行代码
(
出于性能的原因
)
,但是为了防止溢出或下溢操作,要果断地使用
checked
模式。
Int CalcPower(int number,int power)
{
int result=1;
for (int count=1;count<=power;count++)
{
checked
{
result*=number;
}
}
return result;
}
|
68.
使用条件方法来取代显式进行方法调用排除的代码
(#if…#endif)
public class MyClass
{
[Conditional(“MySpecialCondition”)]
公告
QQ
群:
8025234
(验证:
C#.NET
)
专注于
.NET
技术
郑重申明:
1.
如文章标题中注明
“
搜藏
”
字样,即表明该文章是
“
转载
”
,特此申明!
2.
如需转载本
blog
文章,请注明出处,谢谢合作!
访问统计: |
| |||||||||
日
|
一
|
二
|
三
|
四
|
五
|
六
| |||
29
|
30
|
31
|
1
|
2
|
3
|
4
| |||
6
|
7
|
8
|
10
|
11
| |||||
12
|
13
|
14
|
15
|
16
|
17
|
18
| |||
19
|
20
|
21
|
22
|
23
|
24
|
25
| |||
27
|
28
|
29
|
30
|
31
|
1
| ||||
2
|
3
|
4
|
5
|
6
|
7
|
8
|
数据类型
|
数据类型简写
|
标准命名举例
|
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
|
控件类型
|
缩写
|
示例
|
Animated button
|
ani
|
aniMailBox
|
Button
|
btn
|
|
Check box
|
chk
|
chkReadOnly
|
ColorDialog
|
clrdlg
|
|
Combobox,drop-down list box
|
cbo
|
cboEnglish
|
Communications
|
com
|
comFax
|
ContextMenu
|
ctxmnu
|
|
Control(used within procedures when the specific type is unknown)
|
ctr
|
ctrCurrent
|
CrystalReportViewer
|
crvw
|
|
Data
|
dat
|
datBiblio
|
Data grid
|
dgd
|
dgdTitles
|
Data list
|
dbl
|
dblPublisher
|
Data repeater
|
drp
|
drpLocation
|
Data-bound combo box
|
dbcbo
|
dbcboLanguage
|
Data-bound grid
|
dbgrd
|
dbgrdQueryResult
|
Data-bound list box
|
dblst
|
dblstJobType
|
Datetime picker
|
dtp
|
dtpPublished
|
Directory list box
|
dir
|
dirSource
|
DomainUpDown
|
dupd
|
|
Drive list box
|
drv
|
drvTarget
|
ErrorProvider
|
err
|
|
File list box
|
fil
|
filSource
|
Flat scroll bar
|
fsb
|
fsbMove
|
FontDialog
|
fntdlg
|
|
Form
|
frm
|
frmEntry
|
Frame
|
fra
|
fraLanguage
|
Gauge
|
gau
|
gauStatus
|
Graph
|
gra
|
graRevenue
|
Grid
|
grd
|
grdPrices
|
GroupBox
|
grp
|
|
HelpProvider
|
hlp
|
|
Hierarchical flexgrid
|
flex
|
flexOrders
|
HScroll bar
|
hsb
|
hsbVolume
|
Image
|
img
|
imgIcon
|
Image combo
|
imgcbo
|
imgcboProduct
|
ImageList
|
ils
|
ilsAllIcons
|
Label
|
lbl
|
lblHelpMessage
|
Line
|
lin
|
linVertical
|
LinkLabel
|
lnk
|
|
List box
|
lst
|
lstPolicyCodes
|
ListView
|
lvw
|
lvwHeadings
|
MAPI message
|
mpm
|
mpmSentMessage
|
MAPI session
|
mps
|
mpsSession
|
MCI
|
mci
|
mciVideo
|
Menu
|
mnu
|
mnuFileOpen
|
Month view
|
mvw
|
mvwPeriod
|
MonthCalendar
|
mcl
|
|
MS Chart
|
ch
|
chSalesbyRegion
|
MS Flex grid
|
msg
|
msgClients
|
MS Tab
|
mst
|
mstFirst
|
NotifyIcon
|
nti
|
|
NumericUpDown
|
nupd
|
|
OLE container
|
ole
|
oleWorksheet
|
OpenFileDialog
|
ofdlg
|
|
PageSetUpDialog
|
psdlg
|
|
Picture box
|
pic
|
picVGA
|
Picture clip
|
clp
|
clpToolbar
|
PrintDocument
|
prndoc
|
|
PrintPreviewControl
|
ppctl
|
|
PrintPreviewDialog
|
ppdlg
|
|
ProgressBar
|
prg
|
prgLoadFile
|
RadioButton
|
rbtn
|
|
Remote Data
|
rd
|
rdTitles
|
RichTextBox
|
rtf
|
rtfReport
|
SaveFileDialog
|
sfdlg
|
|
Shape
|
shp
|
shpCircle
|
Slider
|
sld
|
sldScale
|
Spin
|
spn
|
spnPages
|
Splitter
|
spt
|
|
StatusBar
|
sta
|
staDateTime
|
SysInfo
|
sys
|
sysMonitor
|
TabContrl
|
tab
|
|
TabStrip
|
tab
|
tabOptions
|
Text box
|
txt
|
txtLastName
|
Timer
|
tmr
|
tmrAlarm
|
Toolbar
|
tlb
|
tlbActions
|
TrackBar
|
trb
|
|
TreeView
|
tre
|
treOrganization
|
UpDown
|
upd
|
updDirection
|
VScroll bar
|
vsb
|
vsbRate
|
1 ADO.NET 命名规范
数据类型
|
数据类型简写
|
标准命名举例
|
Connection
|
con
|
conNorthwind
|
Command
|
cmd
|
cmdReturnProducts
|
Parameter
|
parm
|
parmProductID
|
DataAdapter
|
dad
|
dadProducts
|
DataReader
|
dtr
|
dtrProducts
|
DataSet
|
dst
|
dstNorthWind
|
DataTable
|
dtbl
|
dtblProduct
|
DataRow
|
drow
|
drowRow98
|
DataColumn
|
dcol
|
dcolProductID
|
DataRelation
|
drel
|
drelMasterDetail
|
DataView
|
dvw
|
dvwFilteredProducts
|
2 WinForm Control
命名规范
数据类型
|
数据类型简写
|
标准命名举例
|
Label
|
lbl
|
lblMessage
|
LinkLabel
|
llbl
|
llblToday
|
Button
|
btn
|
btnSave
|
TextBox
|
txt
|
txtName
|
MainMenu
|
mmnu
|
mmnuFile
|
CheckBox
|
chk
|
chkStock
|
RadioButton
|
rbtn
|
rbtnSelected
|
GroupBox
|
gbx
|
gbxMain
|
PictureBox
|
pic
|
picImage
|
Panel
|
pnl
|
pnlBody
|
DataGrid
|
dgrd
|
dgrdView
|
ListBox
|
lst
|
lstProducts
|
CheckedListBox
|
clst
|
clstChecked
|
ComboBox
|
cbo
|
cboMenu
|
ListView
|
lvw
|
lvwBrowser
|
TreeView
|
tvw
|
tvwType
|
TabControl
|
tctl
|
tctlSelected
|
DateTimePicker
|
dtp
|
dtpStartDate
|
HscrollBar
|
hsb
|
hsbImage
|
VscrollBar
|
vsb
|
vsbImage
|
Timer
|
tmr
|
tmrCount
|
ImageList
|
ilst
|
ilstImage
|
ToolBar
|
tlb
|
tlbManage
|
StatusBar
|
stb
|
stbFootPrint
|
OpenFileDialog
|
odlg
|
odlgFile
|
SaveFileDialog
|
sdlg
|
sdlgSave
|
FoldBrowserDialog
|
fbdlg
|
fgdlgBrowser
|
FontDialog
|
fdlg
|
fdlgFoot
|
ColorDialog
|
cdlg
|
cdlgColor
|
PrintDialog
|
pdlg
|
pdlgPrint
|
3 WebControl
命名规范
数据类型
|
数据类型简写
|
标准命名举例
|
AdRotator
|
adrt
|
Example
|
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
|
drop
|
dropCountries
|
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
|