0
作品
我在MVC3視圖中使用HTML編輯器來存儲文章信息爲:數據從HTML編輯器貼在Chrome中
@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「總是會出現空白!!,你能詳細說明什麼不是在鉻合金 – Yasser 2012-08-01 12:18:00
中,你應該在你的問題中說你正在使用[CLEditor](http://premiumsoftware.net/cleditor /) – Yasser 2012-08-01 12:19:38
OtherInformation是模型文章中的一個字段輸入值,其中我使用了Textarea,如代碼所示:@ Html.TextAreaFor(model => model.OtherInformation,new {@id =「OtherInformation」}) – 2012-08-02 05:34:02