首先是服务端,使用前提安装好fckeditor控件 把相关的配置文件 fckeditor放到相应的目录中
1
<FCKeditorV2:FCKeditor id="product_add_details" runat="server" BasePath="~/fckeditor/" Height="370px" Value="不会什么都没有吧">
2
</FCKeditorV2:FCKeditor>
设置好配置路径BasePath 在.cs文件中就可以轻松的通过product_add_details.Value获取
接下来是客户端 首先在引用fckeditor.js 直接给出代码了
1
<script src="http://www.cnblogs.com/fckeditor/fckeditor.js" type="text/javascript"></script>
2
<script type="text/javascript">
3
var oFCKeditor = new FCKeditor( 'FCKeditor1','500px','370px');
4
oFCKeditor.BasePath = "http://www.cnblogs.com/fckeditor/"; //设置配置文件路径
5
oFCKeditor.Value = '客户端的fckeditor' ;
6
oFCKeditor.Create() ;
7
function Button1_onclick() {
8
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
9
alert( oEditor.EditorDocument.body.innerHTML ) ;
10
}
11![]()
12
</script>
13
<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" />
还有其他内容可以参照fckeditor附带的sample\html
<script src="http://www.cnblogs.com/fckeditor/fckeditor.js" type="text/javascript"></script>2
<script type="text/javascript">3
var oFCKeditor = new FCKeditor( 'FCKeditor1','500px','370px');4
oFCKeditor.BasePath = "http://www.cnblogs.com/fckeditor/"; //设置配置文件路径5
oFCKeditor.Value = '客户端的fckeditor' ;6
oFCKeditor.Create() ;7
function Button1_onclick() {8
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;9
alert( oEditor.EditorDocument.body.innerHTML ) ;10
}11

12
</script>13
<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" />



浙公网安备 33010602011771号