Skip to content

Radio Buttons in mVC 4

sai prasad

Asked Aug 4, 2013, 12:01 AM EDT1 answer
Share
LinkedInX
     Hi am super new to asp .net in my project i have a challenge that is in my project i have to generate a radio buttons in mvc 4 . here i have a fields like this Text Area for Questions and 4 radio buttons for options of that particular question. but here am not getting how to achieve this so i request you to please help me in this to achieve this. 
 

  Thanks in Advance

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Are you generating the radio buttons dynamically based on the question?
    You should create the radio button groups based for each question.


    TypeScript
    foreach (var question in questions
    {
    
    
    
                                @Html.RadioButtonFor(m => m.SelectedChoice, @question.id + "_" + @question.name)
                                @question.option    
                       

    }

    Something very similar to the above one.
    0