当前位置: 代码迷 >> ASP.NET >> ASP.NET MVC3 应用kindeditor编辑器获取不到值
  详细解决方案

ASP.NET MVC3 应用kindeditor编辑器获取不到值

热度:7761   发布时间:2013-02-25 00:00:00.0
ASP.NET MVC3 使用kindeditor编辑器获取不到值
ASP.NET MVC3 使用kindeditor编辑器的时候,textarea里的值一直为空,获取不到内容。我写的代码如下:
前台:

@model Jyson.ZhanShiQuan.Model.NoticeHelp
@{
    ViewBag.Title = "AddNotice";
    Layout = "~/Views/Shared/_Admin.cshtml";
}
<script src="../../../../kindeditor/kindeditor.js" type="text/javascript"></script>
<link href="../../../../kindeditor/themes/default/default.css" rel="stylesheet" type="text/css" />
<script src="../../../../kindeditor/lang/zh_CN.js" type="text/javascript"></script>
<script src="../../../../kindeditor/plugins/code/prettify.js" type="text/javascript"></script>
<link href="../../../../kindeditor/plugins/code/prettify.css" rel="stylesheet" type="text/css" />
<script>
    KindEditor.ready(function (K) {
        var editor1 = K.create('#editor', {
            cssPath: '../../../../kindeditor/plugins/code/prettify.css',
            uploadJson: '../../../../kindeditor/asp.net/upload_json.ashx',
            fileManagerJson: '../../../../kindeditor/asp.net/file_manager_json.ashx',
            allowFileManager: true
        });
    });
</script>
<div id="frameBox">
    <div class="frameTitle">
        添加公告</div>
    <div class="frameBody">
        @using (Html.BeginForm("AddNotice", "NoticeHelp", FormMethod.Post, new { @id = "frmSubmit" }))
        {
            <p>
                @Html.LabelFor(model => model.NoticeHelpName, "公告标题:")
                @Html.EditorFor(model => model.NoticeHelpName)
                @Html.ValidationMessageFor(model => model.NoticeHelpName)
            </p> 
            <p>
                @Html.LabelFor(model => model.Content, "内容:")
                @Html.TextAreaFor(model => model.Content, new { id = "editor", rows = "15", cols = "85" })
                @Html.ValidationMessageFor(model => model.Content)
                @* @Html.TextArea("editor", new { rows = "5", style = "width:750px;height: 500px;", @id = "editor" })*@
                @* <textarea id="editor" name="ad_content" cols="100" rows="8" style="width:700px;height:200px;visibility:hidden;" ></textarea>*@
  相关解决方案