今天帮一个CSDN上的童鞋解决该问题,还是简单总结一下吧,主要是需要的一些文件,这里已整理上传到CSDN资源中(0分下载)。
1、xheditor文件下载
http://download.csdn.net/detail/taomanman/3574826
下载后放在根目录下
2、上传配置文件下载
http://download.csdn.net/detail/taomanman/3779192
(PS:
upload.aspx文件中如下行代码 string attachdir ="../upload";//是上传路径,根据实际引用xheditor的页面位置,要进行相应的修改,要不然无法找到位置。
)
也放在根目录下吧
3、在需要的页面上,引用相应的js文件
<head runat="server"> ... <script src="xheditor-1.1.9/jquery/jquery-1.4.2.min.js" type="text/javascript"></script> <script src="xheditor-1.1.9/xheditor_plugins/ubb.min.js" type="text/javascript"></script> <script src="xheditor-1.1.9/xheditor-1.1.9-zh-cn.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $('#tbtmpContent').xheditor({ upLinkUrl: "upload.aspx", upLinkExt: "zip,rar,txt", upImgUrl: "upload.aspx", upImgExt: "jpg,jpeg,gif,png,bmp", upFlashUrl: "upload.aspx", upFlashExt: "swf", upMediaUrl: "upload.aspx", upMediaExt: "wmv,avi,wma,mp3,mid", shortcuts: { 'ctrl+enter': submitForm } }); }); function submitForm() { $('#form1').submit(); } </script> </head> <body> <form id="form1" method="post" runat="server" enctype="multipart/form-data"> <asp:TextBox ID="tbtmpContent" TextMode="MultiLine" BorderWidth="0" runat="server" Width="100%" Height="383px"></asp:TextBox> </form> </body>