Skip to content

Model value getting always false for Radio button in mvc

Seshu B

Seshu B

Asked Aug 29, 2017, 5:34 AM EDT1 answer
Share
LinkedInX
hi all,
in my app if  select radio button value true means getting always false value.
 how to solve this . please provide soultion regarding this 
 
i have tried below code
 
@Html.RadioButtonFor(m => m.AdministratorRefundAccess,true, new { @Name = "SelectedValue" })
@Html.RadioButtonFor(m => m.EmployerRefundAccess, false,new { @Name = "SelectedValue" }) 

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Try this:
     
    TypeScript
    @Html.RadioButtonFor(m => m.AdministratorRefundAccess,true, new { @Name = "AdministratorRefundAccess" })
    @Html.RadioButtonFor(m => m.EmployerRefundAccess, false,new { @Name = "EmployerRefundAccess" })
    
    
    if above code will not work then remove the name tag and try again.
     
    0