ckeditor_3.5.2

简单调用
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns=" http://www.w3.org/1999/xhtml ">
<head>
    <title></title>
    <script src="ckeditor/ckeditor.js" type="text/javascript"></script>
</head>
<body>
    <textarea id="Textarea1" cols="20" rows="2" class="ckeditor"></textarea>
</body>
</html>
 
ASP.NET MVC2  
1.View代码
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns=" http://www.w3.org/1999/xhtml ">
<head runat="server">
    <title>Demo</title>
    <script src="../../ckeditor/ckeditor.js" type="text/javascript"></script>
</head>
<body>
    <%
        using (Html.BeginForm())
        {
    %>
    <div>
        <%: Html.TextArea("editor", new Dictionary<string, object>() { { "class", "ckeditor" } })%>
    </div>
    <div>
        <input id="submit1" type="submit" value="提交" />
    </div>
    <%
        }
    %>
</body>
</html>
2.Controller代码
public ActionResult Demo()
{
        return View();
}
[HttpPost]
[ValidateInput(false)]
public ActionResult Demo(FormCollection collection)
{
        string html = collection["editor"];
        Response.Write(html);
        return View();
}
3.注意处理Post提交的Controller头部标记 [ValidateInput(false)] ,另还需要在Web.config里配置
<system.web>
   <httpRuntime requestValidationMode="2.0"/>
</system.web>
否则提交时会报异常“从客户端XXXX中检测到有潜在危险的 Request.Form 值”。
  
 
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值