MVc 文本框设计样式

<td colspan="6">

<textarea class="content" name="content" style="height:250px;690px">@(Model.content)</textarea>(或者)

@Html.TextAreaFor(it => it.content, 19, 100, new {style="margin:8px 0 0 0;719px;" })

</td>

js显示样式

$(function () {
//正文文本框的样式的实现
KindEditor.ready(function (K) {
K.create('textarea[class="content"]', {
allowImageUpload: true,
cssPath: '@Url.Content("~/KindEditor/plugins/code/prettify.css")',
uploadJson: '@Url.Content("~/KindEditor/Upload")',
fileManagerJson: '@Url.Content("~/KindEditor/Browse")',
allowFileManager: true,
afterCreate: function () { this.sync(); },
afterBlur: function () {
this.sync();
}
});
});

当输入特殊字符时可能会报出输入危险字符

这是在conntrator中的Edit前要加入    [ValidateInput(false)] 取消非法验证

原文地址:https://www.cnblogs.com/zxk3113/p/4653501.html