在mvc3中使用ckeditor时出错 [英] error using ckeditor in mvc3

查看:85
本文介绍了在mvc3中使用ckeditor时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3页如下:

主页:

<!DOCTYPE html>

< html>

< head>

< title> @ ViewBag.Title< / title>

< link href =@ Url.Content(〜/ Content / Site.css) =stylesheettype =text / css/>

< script src =@ Url.Content(〜/ Scripts / jquery-1.4 .4.min.js)type =text / javascript>< / script>

< script type =text / javascript>



$(文件).ready(function(){

$(。ac)。click(function(){

$(。w)。show(fast);

$(。content)。load(/ Ag / Khoitao);

} );

$(。bc)。click(function(){

$(。w)。hide(fast);

$(。content)。empty();

});

});

< /脚本>

< / head>

< body&g t;

I have 3 pages as follows:
Masterpage:
<!DOCTYPE html>
<html>
<head>
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
<script type="text/javascript">

$(document).ready(function () {
$(".ac").click(function () {
$(".w").show("fast");
$(".content").load("/Ag/Khoitao");
});
$(".bc").click(function () {
$(".w").hide("fast");
$(".content").empty();
});
});
</script>
</head>
<body>











我的MVC申请





My MVC Application







@ Html.Partial(_ LogOnPartial)


@Html.Partial("_LogOnPartial")














@RenderBody ()


@RenderBody()











< / body>

< / html>



起始页索引:


</body>
</html>

Start page Index:

<style type="text/css" rel="stylesheet">
    .w {
        width: 1024px;
        height: 500px;
        background-color: blue;
        display: none;
        position: absolute;
        z-index: 1000;
        margin-left: auto;
        margin-right: auto;
        top: 50px;
    }
    .w div
    {
         width: 100%;
        float: left;
    }
    .title_ {
        height: 40px;
        background-color: greenyellow;
    }
    .content {
        height: auto;
        background-color: darkorange;
        overflow: scroll;

    }
</style>
<a href="#" class="ac">Open</a>

<div class="w"><div class="title_"><a href="#" class="bc">Close</a></div><div class="content"></div></div>





和KhoiTao页面:

@model Using_Editor_In_MVC3.Models.Menu

< script src =/ Scripts / ckeditor / ckeditor.jstype =text / javascript>< / script>

< script type =text / javascriptsrc =/ Scripts / ckeditor / adapters / jquery.js>< / script>

< script type = text / javascript>



CKEDITOR.replace(content);



< /脚本>

@using(Html.BeginForm()){

@ Html.ValidationSummary(true)



菜单





And KhoiTao page:
@model Using_Editor_In_MVC3.Models.Menu
<script src="/Scripts/ckeditor/ckeditor.js" type="text/javascript"></script>
<script type="text/javascript" src="/Scripts/ckeditor/adapters/jquery.js"></script>
<script type="text/javascript">

CKEDITOR.replace("content");

</script>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)

Menu



@ Html.LabelFor(model => model.Name)


@Html.LabelFor(model => model.Name)






@ Html.TextAreaFor(model => ; model.Name,new {@id =content,@ class =ckeditor})

@ Html.ValidationMessageFor(model => model.Name)


@Html.TextAreaFor(model => model.Name, new { @id = "content" , @class = "ckeditor" })
@Html.ValidationMessageFor(model => model.Name)



< input type =submitvalue =Create/>


<input type="submit" value="Create" />

推荐答案

(文件).ready(function(){
(document).ready(function () {


(。ac)。click(function(){
(".ac").click(function () {


(。w)。show(fast);
(".w").show("fast");


这篇关于在mvc3中使用ckeditor时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆