我安裝了邏輯上傳器ckeditor在我的項目中,它的安裝沒有問題。我有以下控制器:ckeditor.js:219 Uncaught TypeError:無法設置未定義的屬性'dir'
public class Default1Controller : Controller
{
//
// GET: /Default1/
Context _db = new Context();
[HttpGet]
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult Index(content model)
{
_db.tbl_Content.Add(model);
_db.SaveChanges();
return View();
}
}
和我的內容模型:
public class content
{
[Key]
public int id { get;set; }
public string text { get; set; }
}
我的強類型的索引視圖:
@model ckeditor.Models.content
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Index</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>content</legend>
<div class="editor-label">
@Html.LabelFor(model => model.text)
</div>
<div class="editor-field">
@Html.TextAreaFor(model => model.text)
@Html.ValidationMessageFor(model => model.text)
</div>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
<script src="~/Scripts/ckeditor/ckeditor.js"></script>
<script src="~/Scripts/ckeditor/adapters/jquery.js"></script>
<script>
$(function() {
$('#text').ckeditor();
});
</script>
}
,但我沒有在我的@html.TextAreaFor()
CKEditor的又該我做?
看看控制檯中的第一個錯誤 - 你的腳本的一個沒有被發現(檢查路徑) –