Click here to Skip to main content
15,886,714 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have 2 RadioButton with option Male and Female, i want get string value to save in database, and this my code :

RBModel.cs
C#
[Required(ErrorMessage="Silahkan Pilih Jenis Kelamin")]
        public string JenisKelamin { get; set; }


View/Create.cs
HTML
<div>
           @Html.Label("Jenis Kelamin")
           @Html.RadioButton("rbGrp", "MALE", isChecked :true) @Html.Label("MALE")
           @Html.RadioButton("rbGrp", "FEMALE", isChecked :false) @Html.Label("FEMALE")
       </div>


if radiobutton select then save to database between MALE or FEMALE.

thx for help :-)
Posted
Comments
virang_21 16-Apr-15 0:12am    
check this

http://www.c-sharpcorner.com/UploadFile/4d9083/binding-radiobutton-and-radiobuttonlist-in-various-way-in-mv201/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900