asp.net mvc 3 - How to give names for dynamically generated radiobuttonfor -
asp.net mvc 3 - How to give names for dynamically generated radiobuttonfor -
i generating radiobuttonfor dynamically. code runs as,
@{int questioncount = 0; } @{foreach (sectiondetail sectiondetail in section.sectiondetails) { <table> <tr> <td> @html.label(sectiondetail.title) </td> @{count = 0; } @foreach (sectionscore sectionscore in model.individualsections) { <td class="colsupplier"> @html.radiobuttonfor(model => model.individualsections[count].sectionscores[questioncount].score.pass, true)pass @html.radiobuttonfor(model => model.individualsections[count].sectionscores[questioncount].score.pass, false)fail </td> count++; } </tr> </table> questioncount++; }
here radio buttons having same name. unable exact value. how give different names these radio buttons. please help me in sorting out.
please seek this
@(html.radiobuttonfor(model => model.individualsections[count].sectionscores[questioncount].score.pass, true, new {@id=sectiondetail.title + count.tostring() }) ))
asp.net-mvc-3 radiobuttonfor
Comments
Post a Comment