我试图在asp.net mvc 2中使用html助手输出以下html:如何在asp.net mvc中添加布尔属性?
<input type="text" id="Name" name="Name" value="" autofocus />
我现在正在使用此代码:
<%= Html.TextBoxFor(x => x.Name) %>
我尝试过
// results in <input ... autofocus="" />
<%= Html.TextBoxFor(x => x.Email, new { autofocus="" }) %>
// does not compile
<%= Html.TextBoxFor(x => x.Email, new { autofocus=null }) %>
有什么方法可以使用html帮助器来完成我正在寻找的东西?
我给了它一些时间,看起来你是对,你是第一个,所以我会接受。我仍然很难过。 ;) – bmavity 2010-04-09 19:09:11