@Html.RadioButtonFor(Model => Model.Location, "Location")
@Html.LabelFor(Model=>Model.Location,"Location")
@Html.RadioButtonFor(Model=>Model.Model,"Model")
@Html.LabelFor(Model=>Model.Model,"Model")
@Html.RadioButtonFor(Model=>Model.MovableUnit,"MU")
@Html.LabelFor(Model=>Model.MovableUnit,"MU")
<input id="Location" name="Location" type="radio" value="Location" />
<label for="Location">Location</label>
<input id="Model" name="Model" type="radio" value="Model" />
<label for="Model">Model</label>
<input id="MovableUnit" name="MovableUnit" type="radio" value="MU" />
<label for="MovableUnit">MU</label>
How to have a common name="radiobtn" for all the above Radio buttons? The problem is I want to select only one radio button at a time, but in this case all are selectable at the same time.
Use the function without "for", then you can specify the name:
Just create a dummy property in your Model class like, public string Dummy{get; set;}
Get the value "LOC", "MOD", "MU" using property name 'Dummy'.