VS.NET 2003 Control Naming Specification

xiaoxiao2021-03-04  47

1. Variable naming specification

Type Prefix Example Array arrarrShoppingListBooleanblnblnIsPostBackBytebytbytPixelValueCharchrchrDelimiterDateTimedtmdtmStartDateDecimaldecdecAverageHeightDoubledbldblSizeofUniverseInteger intintRowCounterLong lnglngBillGatesIncomeObject objobjReturnValueShortshrshrAverageSingle sngsngMaximumString strstrFirstName

2. Control naming specification

Type prefix exemplary AdRotatoradrtadrtTopAdButtonbtnbtnSubmitCalendarcalcalMettingDatesCheckBoxchkchkBlueCheckBoxListchklchklFavColorsCompareValidatorvalcvalcValidAge CustomValidatorvalxvalxDBCheckDataGriddgrddgrdTitlesDataListdlstdlstTitlesDropDownListdropdropCountriesHyperLinklnklnkDetailsImageimgimgAuntBettyImageButtonibtnibtnSubmitLabellbllblResultsLinkButtonlbtnlbtnSubmitListBoxlstlstCountriesPanelpnlpnlForm2PlaceHolderplhplhFormContentsRadioButtonradradFemaleRadioButtonList radlradlGenderRangeValidatorvalgvalgAgeRegularExpressionvalevaleEmail_ValidatorRepeaterrptrptQueryResultsRequiredFieldValidatorvalrvalrFirstNameTabletbltblCountryCodes TableCelltblctblcGermanyTableRowtblrtblrCountryTextBoxtxttxtFirstNameValidationSummaryvalsvalsFormErrorsXMLxmlcxmlcTransformResults

3. ADO.NET control naming specification

Example ConnectionconconNorthwind CommandcmdcmdReturnProductsParameterparmparmProductIDDataAdapterdaddadProductsDataReaderdtrdtrProductsDataSetdstdstNorthWindDataTabledtbldtblProductDataRowdrowdrowRow98DataColumndcoldcolProductIDDataRelationdreldrelMasterDetailDataViewdvwdvwFilteredProducts type prefix

4. Event processing subroutine

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.

转载请注明原文地址:https://www.9cbs.com/read-31663.html

New Post(0)