【发布时间】:2013-12-18 16:40:32
【问题描述】:
当我在 MVC 中使用 TextAreaFor 助手并定义如下行时:
@Html.TextAreaFor(model => model.Notes, 5)
此文本区域的行数未设置,这意味着文本区域的大小完全不受影响。但是,如果我使用 htmlAttributes 来定义行:
@Html.TextAreaFor(model => model.Notes, new { rows = 5 })
然后它工作正常。所以我的问题是,如果不定义 textarea 的 rows HTML 属性,TextAreaFor 助手中的 rows 属性是什么?我在这里错过了什么?
【问题讨论】:
标签: .net asp.net-mvc html-helper razor-2