Html.EditorFor多行文本显示

CodeFirst在Model中设置字段:

[DataType(DataType.MultilineText)]

[StringLength(300, ErrorMessage = "录入的字符数超过了300")]

再在前端页面的世style中设置高度宽度

@Html.EditorFor(model => model.Result, new { htmlAttributes = new { @style = "width:330px;height:100px;" } })

posted @ 2017-11-04 10:28  沙闻  阅读(1402)  评论(0编辑  收藏  举报