Generating MVC razor button

Total Post:45

Points:323
C#
 513  View(s)
Ratings:
Rate this:

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

thnks in advance


  1. Post:52

    Points:366
    Re: Generating MVC razor button

    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
    }


Answer