我很好奇......你能指定一个空的或无价值的HTML属性吗? 的W3规范允许empty attributes像这样: <input type="checkbox" disabled checked>
你可以在MVC助手中指定空的HTML属性语法吗?
并与MVC,你声明的投入是这样的:Html.CheckBoxFor(m=>m.Foo)
。 您可以添加HTML与Html.CheckBoxFor(m=>m.Foo, new {@class="myCssClass"})
语法属性,但你不能做Html.CheckBoxFor(m=>m.Foo, new { disabled, checked})
我知道规范也允许自我价值属性为这些类型(例如new {disabled="disabled"}
)和空字符串值(例如new {disabled=""}
)。
我只是好奇,如果有任何方式来指定空的语法。
看到http://stackoverflow.com/questions/4135258/asp-净MVC-htmlattribute-没有价值 – kristian 2010-12-08 01:31:03