我在 mvc 项目中遇到了 ckfinder 的问题。
我在 ckeditor 中移动了 ckfinder 文件夹,并在 config.ascx 中编辑了路径,如下所示:
BaseUrl = "/Content/";
BaseDir = HttpContext.Current.Server.MapPath("~/Content/");
我将js文件添加到_Layout.cshtml:
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/ckeditor/ckeditor.js")"></script>
<script type="text/javascript" src="@Url.Content("~/ckeditor/ckfinder/ckfinder.js")"></script>
最后是我的 Index.cshtml
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">
$(function () {
CKEDITOR.replace('ckEditor', {
skin: 'kama',
filebrowserBrowseUrl: '@Url.Content("~/ckeditor/ckfinder/ckfinder.html")',
filebrowserImageBrowseUrl: '@Url.Content("~/ckeditor/ckfinder/ckfinder.html?type=Images")',
filebrowserFlashBrowseUrl: '@Url.Content("~/ckeditor/ckfinder/ckfinder.html?type=Flash")',
filebrowserUploadUrl: '@Url.Content("~/ckeditor/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files")',
filebrowserImageUploadUrl: '@Url.Content("~/ckeditor/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images")',
filebrowserFlashUploadUrl: '@Url.Content("~/ckeditor/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash")'
});
});
<h2>MVC 3 CKEditor and CKFinder </h2>
@Html.TextArea("ckEditor")
Ckeditor 工作正常,但是当我尝试上传图像(使用 ckfinder)时出现错误=> CKFinder.dll 中出现“CKFinder.Connector.ConnectorException”类型的异常,但未在用户代码中处理
还有我的项目文件=>