【发布时间】:2012-08-01 12:13:56
【问题描述】:
我在 MVC3 视图中使用 Html 编辑器将文章信息存储为:
@using (Html.BeginForm())
{
...
@Html.TextAreaFor(model => model.OtherInformation, new { @id = "OtherInformation" })
...
}
<link href="@Url.Content("~/Content/jquery.cleditor.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.cleditor.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.cleditor.xhtml.min.js")" type="text/javascript"></script>
<script type="text/javascript">
$("#OtherInformation").cleditor();
</script>
在控制器中,我编写了将文章保存为的代码:
[ValidateInput(false)]
[HttpPost]
public ActionResult Create(Article article)
{
if (ModelState.IsValid)
{
article.EntryDate = DateTime.Now;
new ArticleService().SaveOrUpdateArticle(article);
return RedirectToAction("ArticleIndex");
}
return View(article);
}
这一切在 IE 中都可以正常工作,但是当我在 Chrome 中运行相同时,“OtherInformation”总是为空。
【问题讨论】:
-
"OtherInformation" always go Null!?,您能否详细说明 chrome 中的哪些问题 -
你也应该在你的问题中说你正在使用CLEditor
-
OtherInformation 是模型文章中的一个字段输入值,我为其使用了 Textarea,如代码所示:@Html.TextAreaFor(model => model.OtherInformation, new { @id = "OtherInformation" })
-
请尝试评论
$("#OtherInformation").cleditor();并检查错误是否仍然存在,我不确定,但可能是因为 Chrome 最近刚刚更新,仍然不确定只是猜测 :) -
我正在使用 javascript 将此文本区域用作 Html 编辑器:
标签: asp.net-mvc-3 html-editor cleditor