我是asp.net mvc 初学者 现在有一个问题?<div class="form-group">
@Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" })
</div>
</div>我想知道htmlAttributes: new { @class = "control-label col-md-2" }),new { htmlAttributes = new { @class = "form-control" } }),new { @class = "text-danger" }这3种添加样式的方法有什么区别,为啥要这么用?
@Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" })
</div>
</div>我想知道htmlAttributes: new { @class = "control-label col-md-2" }),new { htmlAttributes = new { @class = "form-control" } }),new { @class = "text-danger" }这3种添加样式的方法有什么区别,为啥要这么用?
http://zzk.cnblogs.com/s?w=blog%3Ainsus%20htmlattributes%20