It would be necessary to see how you have defined your model but to see if this example helps you.
If, for example, you have defined an Genero
enumeration:
Public Enum Genero
Femenino
Masculino
End Enum
And, in your model, a property GeneroPersona
of type Genero
:
Property GeneroPersona() As Genero
The code in your view could be something like this:
@Html.LabelFor(Function(m) m.GeneroPersona, New With {.class = "control-label"})
@Html.RadioButtonFor(Function(m) m.GeneroPersona, Genero.Masculino, New With {.Id = "rdMasculino" })
<label for="rdMasculino">Masculino</label>
@Html.RadioButtonFor(Function(m) m.GeneroPersona, Genero.Femenino, New With {.Id = "rdFemenino"})
<label for="rdFemenino">Femenino</label>
The RadioButtonFor
method creates the radiobuttons and assigned you a Id
specific to be able to associate a label with each one.