Q:

Radio button loses value on postback(after postback first button is again checked)

I select football radio button and when I click on submit and after postback
cricket is selected again.football radio button loses value,
<span>
  <input type="radio" id="Cricket" name="SportType" value="1" checked="checked" />Cricket
</span>
<span>
  <input type="radio" id="Football" name="SportType" value="2" />Football
</span>
<span>
  <input type="radio" id="Boxing" name="SportType" value="3" />Boxing
</span>

I get correct value on server end
I am using Asp.net MVC 3
,Firefox 9.0.1

A:

You should use the Html. RadioButton helper to generate radio buttons if you want them to retain values:
<span>
    @Html. RadioButton("SportType", "1", new { id = "Cricket" })
    Cricket
</span>
<span>
    @Html. RadioButton("SportType", "2", new { id = "Football" })
    Football
</span>
<span>
    @Html. RadioButton("SportType", "3", new { id = "Boxing" })
    Boxing
</span>

