如何在默认布局中创建文本区域

时间:2012-03-02 16:24:03

标签: asp.net-mvc-3 html5

每当你为新的创建线程创建一个视图或编辑线程时,你得到的是一个文本框。我需要显示一个文本区域来写我应该怎么做。

1 个答案:

答案 0 :(得分:2)

@Html.TextArea@Html.TextAreaFor

与其他HTML帮助程序相同。

您还可以将以下注释添加到模型中

[DataType(DataType.MultilineText)]

当你致电EditorFor时,你会得到一个textarea而不是一个文本框。

如果您正在谈论实际更改脚手架模板,则需要create your own template.

相关问题