How to add switch group in asp.net mvc3

I have something like a survey and I want users to choose one option from a set of answers to a specific question. Here is an example of what I'm talking about.

radio buttons [1]

+4
source share
2 answers

This will help you if you use the html helper in your code:

@Html.RadioButton("rbGrp", "1", true )<label>Option 1</label> @Html.RadioButton("rbGrp", "2", false )<label>Option 2</label> 
+6
source

You can set the group name in input type format

  <input type="radio" name='group1' value="Milk"> Milk <input type="radio" name='group1' value="Butter"> Butter 
+1
source

Source: https://habr.com/ru/post/1415336/


All Articles