读书人

关于MVC调用KindEditor控件无法插入

发布时间: 2013-02-03 12:33:31 作者: rapoo

关于MVC调用KindEditor控件,无法插入数据库问题
前台页面代码:


[解决办法]
http://bbs.csdn.net/posts/393569842 看你这贴 最下面 建几个页面 copy 然后测试
[解决办法]
View 页面
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AdminViewMasterPage.Master" Inherits="System.Web.Mvc.ViewPage<Pharmacy.Models.CompanyInfo>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">


<%= Model.Title%>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/kindeditor/kindeditor.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/kindeditor/lang/zh_CN.js" type="text/javascript"></script>

<script charset="utf-8" style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/kindeditor/plugins/code/prettify.js" type="text/javascript" ></script>
<h2><%= Model.Title%></h2>
<% using (Html.BeginForm())
{%>
<fieldset>
<legend>修改页面内容</legend>



<div class="editor-label">
<label for="InfoContent">内容:</label>
</div>
<div class="editor-field">
<textarea id="InfoContent" name="InfoContent" style="width:700px;height:300px;"><%= Model.TextContent%></textarea>
</div>
<p>
<input type="submit" value="保存" />
</p>
</fieldset>
<%} %>

<script type="text/javascript">
KindEditor.ready(function (K) {
var editor1 = K.create('#InfoContent', {
cssPath: '../plugins/code/prettify.css',
uploadJson: '/Admin/UploadFileJson',
fileManagerJson: '../asp.net/file_manager_json.ashx',
allowFileManager: true,
afterCreate: function () {
var self = this;
K.ctrl(document, 13, function () {
self.sync();
K('form[name=example]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function () {


self.sync();
K('form[name=example]')[0].submit();
});
}
});
prettyPrint();
});
</script>

</asp:Content>


[解决办法]
引用:
这是添加的页面代码:
XML/HTML code?1234567<%@ Page Language="C#" validateRequest="false" Inherits="System.Web.Mvc.ViewPage" %><%@ Import Namespace="BookShop.Models.SystemManager" %><%@ Import Nam……

如果是这样的话,你可以把添加的页面删除,然后把编辑页面复制给添加的,这样可以测试下

读书人网 >asp.net

热点推荐