Generating MVC razor button

How can i generate radiobuttons, and get the desired value in the form collection as YES/NO True/False) ?

thnks in advance

Last updated:12/18/2017 12:24:33 AM

1 Answers

Manish Kumar
Manish Kumar

In order to do this for multiple items do something like:

foreach (var item in Model)

    @Html.RadioButtonFor(m => m.item, 'Yes') @:Yes
    @Html.RadioButtonFor(m => m.item, 'No') @:No