check boxes and radio button labels are included in the <Label> tab
<div class= "checkbox" > <label><input type= "checkbox" Value= "" > Options 1</label></div> <div class= "checkbox" > <label><input type= "checkbox" Value= "" > Options 2</label></div>
<div class= "Radio" > <label> <input type= "Radio" name= "Optionsradios" id= "OPTIONSRADIOS1" value= "option1" checked> option 1 </label></div><div class= "Radio" > <label> <input type= "Radio" name= "Optionsradios" id= "OptionsRadios2" value= "option2" > option 2-select it will deselect option 1 </label>
Inline check boxes and radio buttons,
- Use the . Checkbox-inline or . Radio-inline class for a series of check boxes and radio boxes to control their display on the same line.
<div> <label class= "Checkbox-inline" > <input type= "checkbox" Id= "Inli NeCheckbox1 "value=" option1 "> Option 1 </label> <label class=" Checkbox-inline "> <input type=" checkb Ox "id=" InlineCheckbox2 "value=" Option2 "> Options 2 </label> <label class=" Checkbox-inline "> <input type= "checkbox" id= "InlineCheckbox3" value= "Option3" > Options 3 </label> <label class= "Checkbox-inline" > <input type= "Radio" name= "Optionsradiosinline" id= "OptionsRadios3" value= "option1" checked> option 1 </l abel> <label class= "Checkbox-inline" > <input type= "Radio" name= "Optionsradiosinline" id= "OptionsRadios4 Code for "value=" option2 "> Option 2 </label></div>
Scaffolding automatically created CREATE view:
If the member of an object is an enumeration type, the CREATE view of the scaffolding automatically generates the drop-down menu for the enumeration type. @Html. enumdropdownlistfor (model = model. NotificationType, htmlattributes:new {@class =
"Form-control"})
<div class= "Form-group" >
@Html. labelfor (model = model. NotificationType, htmlattributes:new {@class = "Control-label col-md-2"})
<div class= "Col-md-10" >
@Html. enumdropdownlistfor (model = model. NotificationType, htmlattributes:new {@class = "Form-control"})
Although the @html.editorfor method is used below, the MVC framework recognizes that it is a Boolean type, so a checkbox is used to render the view.
<div class= "Form-group" >
@Html. labelfor (model = model. Isdismissed, htmlattributes:new {@class = "Control-label col-md-2"})
<div class= "Col-md-10" >
<div class= "checkbox" >
@Html. editorfor (model = model. isdismissed)
@Html. validationmessagefor (model = model. Isdismissed, "", new {@class = "Text-danger"})
</div>
</div>
</div>
@Html. validationmessagefor (model = model. NotificationType, "", new {@class = "Text-danger"})
</div>
</div>
Bootstrap check boxes and radio buttons