ASlP
-
Upload
baneeishaquek -
Category
Documents
-
view
212 -
download
0
description
Transcript of ASlP
-
7/4/2015 ASP.NETWebControl:TheRadioButtonList
http://www.csharpkey.com/aspnet/controls/radiobuttonlist.htm 1/3
WebControl:TheRadioButtonListRadioButtonListFundamentalsIntroductionToassistyouwithcreatingagroupofradiobuttons,youcanusetheRadioButtonListcontrol.This control is implemented by the RadioButtonList class defined in theSystem.Web.UI.WebControlsnamespaceoftheSystem.Web.dllassembly.
CreatingaRadioButtonListTovisuallycreatearadiobuttonlist,fromtheStandardsectionoftheToolbox,youcandragRadioButtonListanddropitontheform.Youwouldbeaskedtocreateeachitemofthegroup.Todothis,youcanclickitsarrowbuttonandclickEditItems,thenusetheListItemCollectionEditor:
Iftheradiobuttonlistwasalreadycreated,toaccesstheListItemCollectionEditor,clicktheradiobuttonlistontheform.InthePropertieswindow,clickItemsandclickbrowsebutton.
Tomanuallycreateagroupofradiobuttons,createantagontheform:
Exercise
Exercise
Tocreateeachitemofthegroup,
IfyouareusingtheListItemCollectionEditor,clickAddIfyouareworkingmanually,betweentheopeningandtheclosingtags,createanasp:ListItemtagwithitsownstartingandclosingtags:
Exercise
-
7/4/2015 ASP.NETWebControl:TheRadioButtonList
http://www.csharpkey.com/aspnet/controls/radiobuttonlist.htm 2/3
CharacteristicsofaRadioButtonListTheCaptionsofRadioButtonsObviouseachradiobuttonshoulddisplaytexttoshowwhatitisusedfor:
IfyouareworkingintheListItemCollectionEditor,ontheleftside,clickanitem.Ontherightside,clickTextandtypethedesiredstringIfyouareworkingmanually,tospecifythecaptionofaradiobutton,typeitsstringbetweenthebeginningandtheendingtags
Hereareexamples:
Exercise
MaleFemaleUnknown
Thiswouldproduce:
TheCaptionAlignmentofaRadioButtonBydefault, the captions of the radiobuttons arepositionedon the right side of their roundboxes. This characteristic is controlled by the TextAlign attribute of the RadioButtonListcontrolandwhosedefaultvalueisRight.Ifyouwantthecaptionstobepositionedtotheleft,assigntheLeftstringtothisattribute.Hereisanexample:
Exercise
-
7/4/2015 ASP.NETWebControl:TheRadioButtonList
http://www.csharpkey.com/aspnet/controls/radiobuttonlist.htm 3/3
MaleFemaleUnknown
Thiswouldproduce:
Home Copyright20092011C#Key