xhEditor 嵌入到ASP.NET的步骤
来源:互联网 发布:代理服务器ip和端口 编辑:程序博客网 时间:2024/05/01 17:59
转载自http://blog.csdn.net/lyshrine/article/details/6803106
最近在一个开发源码的系统里,把原来html编辑器换成了国产开源的xhEditor。在此记录下嵌入的步骤和注意事项。
(目前在此写的就是xhEditor,呵呵。CSDN用的就是这个)
Demo下载
1. 下载:
http://xheditor.com/ 下载最新版本编辑器
2.相关目录文件放入项目:
1)把解压包里的xheditor_emot xheditor_plugins xheditor_skin 目录以及xheditor-1.1.10-zh-cn.min.js 放到指定的JS目录里
(比如我放到了EnterpriseWeb.Web\Admin\js\xhEditor)
2)把压缩包里的demos\upload.aspx 和 saveremoteimg.aspx 放到与js同级的目录下(如:EnterpriseWeb.Web\Admin)
3.修改配置文件:
修改upload.aspx文件:找到 attachdir ,改为 string attachdir = Page.ResolveUrl("~/upload"); // 上传文件保存路径,结尾不要带/
(也可不修改,不修改则以后上传的图片放到了EnterpriseWeb.Web\Admin下的upload目录,按以上修改是放到了根目录EnterpriseWeb.Web下的upload下 )
4.修改相应界面:
修改需要用到xheditor编辑器的页面:
1)在第一行 <%@ Page Language="C#" .... 中增加参数 ValidateRequest="false" (这样就不会提交时失败提示安全隐患,当然这样可能会不安全,还需要别的地方控制)
2)加入 js 代码(这里控制编辑器用了JQUERY ,路径根据具体情况可修改):如下
<script src="js/jquery-1.6.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('#' + '<%=elm1.ClientID %>').xheditor({ upLinkUrl: "upload.aspx", upLinkExt: "zip,rar,txt", upImgUrl: "upload.aspx", upImgExt: "jpg,jpeg,gif,png", upFlashUrl: "upload.aspx", upFlashExt: "swf", upMediaUrl: "upload.aspx", upMediaExt: "avi" });
})
</script>
<script src="js/xhEditor/xheditor-1.1.10-zh-cn.min.js" type="text/javascript"></script>
3)在需要用到编辑器的地方加入如下代码:(id="elm1"需要与以上JS相对应)
<textarea id="elm1" runat="server" name="txtContent" rows="12" cols="80" style="width: 80%"></textarea>
- xhEditor 嵌入到ASP.NET的步骤
- xhEditor 嵌入到ASP.NET的步骤
- xhEditor 嵌入到ASP.NET的步骤 .
- xhEditor 在ASP.Net中使用步骤
- 将你的Asp.NET应用程序嵌入到SharePoint
- 将你的Asp.NET应用程序嵌入到SharePoint
- 将你的Asp.NET应用程序嵌入到SharePoint
- 将你的Asp.NET应用程序嵌入到SharePoint
- 将你的Asp.NET应用程序嵌入到SharePoint 读后感
- 将你的Asp.NET应用程序嵌入到SharePoint
- [asp.net] xheditor 圖片上傳 功能
- 将Asp.NET应用程序嵌入到SharePoint
- asp.net嵌入的资源
- 将ASP.NET网站嵌入到MOSS站点下面的做法
- 高效管理ASP.NET的JavaScript库,把JS文件嵌入到DLL中
- asp.net 嵌入realplayer
- 学习Asp.Net的步骤
- asp.net留言板 利用富文本编辑器实现美化功能xheditor在asp.net网页的配置和使用
- fedora 16 安装mplayer
- 腾讯VS百度
- 2011年回顾以及2012年展望
- windows 2008 NLB (网络负载均衡
- 我的第一次SAS编程
- xhEditor 嵌入到ASP.NET的步骤
- hive导入数据丢失问题
- 从未谋面只闻其名——缅怀张孝祥老师!
- MFC INI文件读写
- ChartDirector 5.0 for python 笔记【10】CDML 标记语言
- php 截取UTF-8 GBK汉字
- SimpleOnGestureListener中各种Touch事件
- Using Android monkeyrunner from Eclipse, both in Windows and Linux!
- 12.01.01 ~ 12.01.07