title: Able to Select multiple options for radiobuttons in ASP.NET MVC
body: <p>I am working on developing on a voting page mechanism. Here I will have the List of questions and against each question I have 3 options(I am using radio buttons). I have attached my View and Controller method. I am getting the value saved to DB correctly, but my problem is I am able to select multiple options where radio buttons are used. I want to make sure that, if one option is selected for a question the other options must be automatically deselected, which is not happening for me.</p>
  
  <p>My View : </p>
  
  <pre><code> @using (Html.BeginForm())
   {   
          &lt;div&gt;
           @foreach (var a in ViewBag.Questions)
           {
               &lt;h4&gt;@a.Questions&lt;/h4&gt;
               &lt;div&gt;
                  @foreach (var b in Model)
                  {
                     if (b.QuestionsID == a.id)
                     {                                  
                        @Html.RadioButton(b.AnswersOptions, 
                                 new {Answerid= b.id, Questionid=a.id })                     
                        @b.AnswersOptions
                     }
                  }
               &lt;/div&gt;
           }
  
          &lt;/div&gt;
          &lt;br/&gt;
  
          &lt;div &gt;
             &lt;input type="submit" value="Vote Now!!" 
                  onclick="return confirm('Are you sure you want to                                         
                  submit your choices?');"/&gt;
          &lt;/div&gt;
   }
  </code></pre>
  
  <p>My Controller :</p>
  
  <pre><code>    public ActionResult VotingResult_Post(FormCollection resultcollection)
      { 
          int resultcollectionCount = resultcollection.Count;
  
          if (resultcollectionCount == CountofQuestionsDisplayed)
          {
              for (int i = 0; i &lt; resultcollectionCount; i++)
              {
                  string SelectedIDArray = resultcollection[i];
                  string SelectedAnswerIDValue = GetValue("Answerid", SelectedIDArray);                                                                                
                  string SelectedQuestionID = GetValue("Questionid", SelectedIDArray);                 
  
                  InsertUsersReponses(SelectedQuestionID, SelectedAnswerIDValue);                   
              }
          }
  
          List&lt;Voting_Questions&gt; QuesList = PopulateQuestions();
          ViewBag.Questions = QuesList;
          List&lt;Voting_Answers&gt; Answers = aobj.Voting_Answers.ToList();
          return View(Answers);
      }
  </code></pre>