asp.net服务器控件命名规范
控件名称(标准) |
前缀 |
示例 |
Label |
Lbl |
LblResults |
TextBox |
Txt |
TxtFirstName |
Button |
Btn |
BtnSubmit |
LinkButton |
Lbtn |
LbtnSubmit |
ImageButton |
Ibtn |
IbtnSubmit |
HyperLink |
Lnk |
LnkDetails |
DropDownList |
Drop |
DropCountries |
ListBox |
Lst |
LstCountries |
CheckBox |
Chk |
ChkBlue |
CheckBoxList |
Chkl |
ChklFavColors |
RadioButton |
Rad |
RadFemale |
RadioButtonList |
Radl |
RadlGender |
Image |
Img |
ImgAuntBetty |
ImageMap |
Imgm |
|
Table |
Tbl |
TblCountryCodes |
BulletedList |
Bltl |
|
HiddenField |
Hdn |
|
Literal |
Ltr |
|
Calendar |
|
CalMettingDates |
AdRotator |
Adrt |
AdrtTopAd |
FileUpload |
Fup |
|
Wizard |
Wzd |
|
XML |
Xmlc |
XmlcTransformResults |
MultiView |
Mltv |
|
Panel |
Pnl |
PnlForm2 |
PlaceHolder |
Plh |
PlhFormContents |
View |
View |
|
Substitution |
Sbtt |
|
Localize |
Lcl |
|
控件名称(数据) |
前缀 |
示例 |
GridView |
Gdv |
GdvArticles |
DataList |
Dlst |
DlstTitles |
DetailsView |
Dtv |
|
FormView |
Fmv |
|
Repeater |
Rpt |
RptQueryResults |
SqlDataSource |
Sds |
|
AccessDataSource |
Ads |
|
XmlDataSource |
Xds |
|
SiteMapDataSource |
Mds |
|
ObjectDataSource |
Ods |
|
ReportViewer |
Rpv |
|
控件名称(验证) |
前缀 |
示例 |
RequiredFieldValidator |
Valr |
ValrFirstName |
RangeValidator |
Valg |
ValgAge |
RegularExpression |
Vale |
ValeEmail_Validator |
CompareValidator |
Valc |
ValcValidAge |
CustomValidator |
Valx |
ValxDBCheck |
ValidationSummary |
Vals |
ValsFormErrors |
控件名称(导航) |
前缀 |
示例 |
SiteMapPath |
Smp |
|
Menu |
Mnu |
|
TreeView |
Trv |
|
控件名称(登录) |
前缀 |
示例 |
Login |
Lg |
|
LoginView |
Lgv |
|
PasswordRecovery |
Psr |
|
LoginStatus |
Lgs |
|
LoginName |
Lgn |
|
CreateUserWizard |
Cuw |
|
ChangePassword |
Cpw |
|
|
|
|
控件名称(其他) |
前缀 |
示例 |
TableCell |
Tblc |
TblcGermany |
TableRow |
Tblr |
TblrCountry |