[导入]BlogEngine中编辑器插入的方法

它一共用到两个用户控件:
1.FCK .ascx 这个用户控件用来插入编辑器。
<% @ Control Language = " C# " AutoEventWireup = " true " CodeFile = " Fck.ascx.cs " Inherits = " admin_Fck " %>
<% @ Register Assembly = " FredCK.FCKeditorV2 " Namespace = " FredCK.FCKeditorV2 " TagPrefix = " FCKeditorV2 " %>
< FCKeditorV2:FCKeditor ID = " FCKeditor1 " runat = " server " Height = " 400px " >
</ FCKeditorV2:FCKeditor >
后台代码:
public partial class admin_Fck : System.Web.UI.UserControl
... {
public string Text
...{
get
...{
return FCKeditor1.Value.ToString();
}

set
...{
FCKeditor1.Value
= value;
}

}

}
上面这个编辑器就用来Text这个属性,属性值就是编辑器里的文章了。
它这个还有一个自定义控件。
htmlEditor.ascx
这个htmlEditor用来放上面这个FCK。ascx
1 <% @ Control Language = " C# " AutoEventWireup = " true " CodeFile = " htmlEditor.ascx.cs " Inherits = " admin_htmlEditor " %>
2 <% @ Register Src = " Fck.ascx " TagName = " Fck " TagPrefix = " uc2 " %>
3 <% @ Import Namespace = " BlogEngine.Core " %>
4
5
6 < uc2:Fck id = " Fck1 " runat = " server " ></ uc2:Fck >

htmlEditor.cs
public string Text
... {
get ...{ return FCK1.Text; }
set ...{ FCK1.Text = value; }
}
这里同样有一个Text属性。
在这样定义之后,在真正要编辑器的页面就这样插入htmlEditor。ascx控件,页面要取值也只要去htmlEditor.Text。但是这样我就为自定义别的编辑器带来了方便,还是只要定义一个自定义用户控件,定义Text属性就好了。这样就不用去动真正要用编辑器的页面了。

文章来源: http://www.link-to.cn/post/2007/10/BlogEngine.aspx

转载于:https://www.cnblogs.com/sliuqin/archive/2007/10/20/933615.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值