I am using MVC3 with Razor.
I would like to generate id's for my radio button dynaically. I am calling my code in loop and the id's / name's should be generated dynaically. Name to my radiobutton in my View...like below code....
@Html.RadioButtonFor(m => m.ClaimEntity.Claim, "True", Model.m.ClaimEntity.Claim.Equals(true) ? new { name = "Claim_" + ViewData["count"].ToString(), id = "Claim", title = "Claim_" + ViewData["count"].ToString() } : null)
@Html.Label("Yes")
@Html.RadioButtonFor(m => m.ClaimEntity.Claim, "False", Model.m.ClaimEntity.Claim.Equals(false) ? new { name = "Claim_" + ViewData["count"].ToString(), id = "Claim", title = "Claim_" + ViewData["count"].ToString() } : null)
@Html.Label("No")
Problem is, the above code snippet does not show the dynamic id created for radiobutton whereas it shows the "title" created dynaimically, so I need something on similar line for "title" for "id" and "name" attribute.
Plz suggest how can i get this working. Regards,