开发者

Associate a label to MVC RadioButtonFor element

Hi fairly new to using MVC radio buttons开发者_如何学编程. I have some code:

@Html.RadioButtonFor(modelItem => item.CheckerApproved, true)
<label for="?">Accepted</label>
@Html.RadioButtonFor(modelItem => item.CheckerApproved, false)
<label for="?">Rejected</label>

As you can see I'm not sure how to associate the label with the radiobutton.

Can someone please help me with this?


Use the LabelFor helper.

@Html.LabelFor(m => m.CheckerApproved)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜