C#编码规范之VS2005控件命名
最近新项目开始了,项目团队开发需要更高的要求,编码规范自然不能少,以前的编码规范是针对.NET 1.1版的,现在改用VS2005开发。NET 2.0新增了一些控件,需要更新控件命名这一块。
在网上找了一会,没有找到关于VS2005控件命名的文档,只好自已动手了,本着参考原文档的习惯,更新了控件命名这一块。和大家分享一下。
Standard Control
类 型 | 前 缀 | 示 例 |
Adrotator | adrt | adrtTopAd |
BulletedList | blst | blstCity |
Button | btn | btnSubmit |
Calendar | cal | calMettingDates |
CheckBox | chk | chkBlue |
CheckBoxList | chkl | chklFavColors |
DropDownList | drop | dropCountries |
FileUpLoad | fup | fupImage |
HiddenField | hfld | hfldName |
HyperLink | hlk | hlkDetails |
Image | img | imgAuntBetty |
ImageButton | ibtn | ibtnSubmit |
ImageMap | imap | imapSite |
Label | lbl | lblResults |
LinkButton | lbtn | lbtnSubmit |
ListBox | lst | lstCountries |
Literal | ltl | ltlTitle |
Localize | loc | locChina |
MultiView | mvw | mvwForm1 |
Panel | pnl | pnlForm2 |
PlaceHolder | plh | plhFormContents |
RadioButton | rad | radFemale |
RadioButtonList | radl | radlGender |
SubStitution | subs | subsTime |
Table | tbl | tblCountryCodes |
TextBox | txt | txtFirstName |
View | vw | vwCity |
Wizard | wiz | wizRegister |
Xml | xml | xmlBooks |
Data Control
类 型 | 前 缀 | 示 例 |
AccessDataSource | ads | adsPubs |
DataList | dlst | dlstTitles |
DetailView | dvw | dvwTitles |
FormView | fvw | fvwFonts |
GridView | gvw | gvwCity |
ObjectDataSource | ods | odsMenus |
Repeater | rpt | rptQueryResults |
ReportViewer | rvw | rvwRecord |
SiteMapDataSource | smds | smdsSite |
SqlDataSource | sds | sdsBooks |
XmlDataSource | xds | xdsTitles |
Validation Control
类 型 | 前 缀 | 示 例 |
CompareValidator | valc | valcValidAge |
CustomValidator | valx | valxDBCheck |
RangeValidator | valg | valgAge |
RegularExpressionValidator | vale | valeEmail |
RequiredFieldValidator | valr | valrFirstName |
ValidationSummary | vals | valsFormErrors |
Navigation Control
类 型 | 前 缀 | 示 例 |
Menu | mnu | mnuUser1 |
SiteMapPath | smp | smpSite1 |
TreeView | trvw | trvwMenu |
Login Control
类 型 | 前 缀 | 示 例 |
ChangePassword | cpwd | cpwdUser1 |
CreateUserWizard | cuw | cuwLogin |
Login | log | logCenter |
LoginName | logn | lognUser |
LoginStatus | logs | logsUser |
LoginView | logv | logvUser |
PasswordRecovery | pwdr | pwdrUser |
WebParts Control
类 型 | 前 缀 | 示 例 |
AppearanceEditorPart | paed | paedPart1 |
BehaviorEditorPart | pbed | pbedPart2 |
CatalogZone | zca | zcatCity |
ConnectionsZone | zcon | zconDataBase |
DeclarativeCatalogPart | pdca | pdcaPart1 |
EditorZone | zed | zedNews |
ImportCatalogPart | pica | picaPart |
LayoutEditorPart | pled | pledNews |
PageCatalogPart | ppca | ppcaMail |
PropertyGridEditorPart | ppge | ppgeServer |
ProxyWebPartManager | mpwp | mpwpWeb |
WebPartManager | mwp | mwpSite1 |
WebPartZone | zwp | zwpSite2 |
-- ============================================= -- Author:Ryoan Dan -- Create date: 2007-05-11 -- Description:C#编码规范之VS2005控件命名 -- =============================================