HTML.TextAreaFor MVC3

Mik*_*ebb 0 textarea asp.net-mvc-3

我有大量的文本数据要显示在HTML.TextAreaFor()之类的内容中.我使用readonly html属性尝试了这个.但是,用户仍然可以选择日期并单击框.这让用户感到困惑.是否有我可以使用的另一个控件,或者是HTML.TextAreaFor()的其他属性,我可以使用它来使其看起来不可编辑.

@Html.TextArea("SOWDescription", Model.SowDescription,
     new { rows = 5, cols = 50, @class = "celltext2", @readonly="true" })
Run Code Online (Sandbox Code Playgroud)

TextAreaFor 在此输入图像描述

twa*_*ggs 5

你可以把它放在像div这样的东西,并允许它使用CSS滚动:

<div style="height: 300px; overflow: scroll;">@Model.SowDescription</div>
Run Code Online (Sandbox Code Playgroud)