您的位置:首页 > 其它

VS.NET 2003 控件命名规范

2005-12-09 13:00 387 查看
   VS.NET 2003 控件命名规范 

Type
Prefix
Example
ArrayarrarrShoppingList
BooleanblnblnIsPostBack
BytebytbytPixelValue
CharchrchrDelimiter
DateTimedtmdtmStartDate
DecimaldecdecAverageHeight
DoubledbldblSizeofUniverse
IntegerintintRowCounter
LonglnglngBillGatesIncome
ObjectobjobjReturnValue
ShortshrshrAverage
SinglesngsngMaximum
StringstrstrFirstName
 

WebControls

Type
Prefix
Example
AdRotatoradrtadrtTopAd
ButtonbtnbtnSubmit
CalendarcalcalMettingDates
CheckBoxchkchkBlue
CheckBoxListchklchklFavColors
CompareValidatorvalcvalcValidAge
CustomValidatorvalxvalxDBCheck
DataGriddgrddgrdTitles
DataListdlstdlstTitles
DropDownListdropdropCountries
HyperLinklnklnkDetails
ImageimgimgAuntBetty
ImageButtonibtnibtnSubmit
LabellbllblResults
LinkButtonlbtnlbtnSubmit
ListBoxlstlstCountries
PanelpnlpnlForm2
PlaceHolderplhplhFormContents
RadioButtonradradFemale
RadioButtonListradlradlGender
RangeValidatorvalgvalgAge
RegularExpressionvalevaleEmail_Validator
RepeaterrptrptQueryResults
RequiredFieldValidatorvalrvalrFirstName
TabletbltblCountryCodes
TableCelltblctblcGermany
TableRowtblrtblrCountry
TextBoxtxttxtFirstName
ValidationSummaryvalsvalsFormErrors
XMLxmlcxmlcTransformResults
 

ADO.NET

TypePrefixExample
ConnectionconconNorthwind
CommandcmdcmdReturnProducts
ParameterparmparmProductID
DataAdapterdaddadProducts
DataReaderdtrdtrProducts
DataSetdstdstNorthWind
DataTabledtbldtblProduct
DataRowdrowdrowRow98
DataColumndcoldcolProductID
DataRelationdreldrelMasterDetail
DataViewdvwdvwFilteredProducts

Event-Handling Subroutines

The name of an event-handling subroutine will consist of the ID of the control that rasied the event followed by the type of event being handled. For example, a subroutine named btnSubmit_Click handles the Click event of a Button control named btnSubmit.When a control that raises an event is not assigned an ID, the type of the control is used instead of the ID. For example, the subroutine named Button_Click handles the Click event of a Button control without an ID.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息