【发布时间】:2014-11-08 20:39:57
【问题描述】:
我无法弄清楚为什么复选框不显示值。原代码是
<input type="checkbox" name="@row.Checkbox.Name" value="@row.Checkbox.Text"/>
生成的 HTML 是
<input type="checkbox" name="chkparent" value=" I am the parent or legal guardian of the named child/children in my family membership and I give consent for them to take part in organised paddling activities (Kayak and/or Canoe) and I agree they will abide by the rules and regulations of Totnes Canoe Club at all times."/>
我尝试将生成的 html 直接放在页面中,但仍然没有显示值。 我看到的只是复选框。
【问题讨论】:
-
如果你想显示一些文字,你需要创建一个标签或类似的元素。
-
通常复选框的值为真或假,即绑定到布尔值
标签: html asp.net asp.net-mvc asp.net-mvc-4 checkbox