FreeTextBox 4.0 版控件的使用方法及下载_倾颜戏羽

FreeTextBox是一个免费的、广泛应用于Asp.Net的新闻发布系统和博客中的一个控件;freeTextBox类似于微软的RTF控件。可以设置字体、颜色、插入图片、建立超级链接、插入表格等操作,功能十分强大。到目前我发现最新的版本为4.0 beta1版,使用方法也比较简单。

一、下载FreeTextBox文件。(单击这里下载

二、解压后,把【Asp.Net】文件夹中的【2.0】文件夹里面的Refresh.Web.FreeTextBox.dll文件复制到你站点中的【Bin】文件夹里。复制【Refresh_Web】文件夹到你的站点根目录下。

三、添加引用

在Vs2005的解决方案窗口中单击右键,选择“添加引用”命令,在弹出的对话框中单击浏览选项卡,找到站点文件夹中Bin里面的Refresh.Web.FreeTextBox.dll文件,单击确定。

把Refresh.Web.FreeTextBox.dll动链文件直接拖动到工具栏的“常规”选项卡中,这时在常规选项卡里会出现三个按钮:ToolBar、floatie和FreeTextBox。

三、新建一个页面Default.Aspx,把FreeTextBox拖放到页面中。

四、设置FreeTextBox控件的工具栏,切换页面至源代码视图。

FTB:FreeTextBox id="FreeTextBox1" runat="SErver" Width="900px" Height="500px" Theme="office12"     IsFullDocument="true"> 在这段代码后面插入下列代码,用来设置显示的工具栏按钮。
         <FTB:ToolbarGroup Title="Font" >
              <FTB:ToolbarItem Name="ParagraphMenu" />
              <FTB:ToolbarItem Name="FontFacesList" />
              <FTB:ToolbarItem Name="FontSizesList" />
              <FTB:ToolbarItem Name="break" />
              <FTB:ToolbarItem Name="Bold" />
              <FTB:ToolbarItem Name="Italic" />
              <FTB:ToolbarItem Name="Underline" />
              <FTB:ToolbarItem Name="Strikethrough" />
              <FTB:ToolbarItem Name="separator" />
              <FTB:ToolbarItem Name="Superscript" />
              <FTB:ToolbarItem Name="Subscript" />
              <FTB:ToolbarItem Name="separator" />
              <FTB:ToolbarItem Name="FontForeColorPicker" />
              <FTB:ToolbarItem Name="FontBackColorPicker" />
         </FTB:ToolbarGroup>
         <FTB:ToolbarGroup Title="Format">
              <FTB:ToolbarItem Name="BulletedList" />
              <FTB:ToolbarItem Name="NumberedList" />
              <FTB:ToolbarItem Name="Indent" />
              <FTB:ToolbarItem Name="Outdent" />
              <FTB:ToolbarItem Name="break" />
              <FTB:ToolbarItem Name="JustifyLeft" />
              <FTB:ToolbarItem Name="JustifyRight" />
              <FTB:ToolbarItem Name="JustifyCenter" />
           <FTB:ToolbarItem Name="JustifyFull" />
         </FTB:ToolbarGroup>
         <FTB:ToolbarGroup Title="Edit">
              <FTB:ToolbarItem Name="Cut" />
              <FTB:ToolbarItem Name="Copy" />
              <FTB:ToolbarItem Name="Paste" />
              <FTB:ToolbarItem Name="PasteFromWord" />
              <FTB:ToolbarItem Name="PasteCode" />
              <FTB:ToolbarItem Name="break" />
              <FTB:ToolbarItem Name="Undo" />
              <FTB:ToolbarItem Name="Redo" />  
              <FTB:ToolbarItem Name="Print" />
              <FTB:ToolbarItem Name="Save" />
              <FTB:ToolbarItem Name="Clear" />
         </FTB:ToolbarGroup>
         <FTB:ToolbarGroup Title="Table">
              <FTB:ToolbarItem Name="InsertTable" />
              <FTB:ToolbarItem Name="InsertTableColumnBefore" />
              <FTB:ToolbarItem Name="InsertTableColumnAfter" />
              <FTB:ToolbarItem Name="InsertTableRowBefore" />
              <FTB:ToolbarItem Name="InsertTableRowAfter" />
              <FTB:ToolbarItem Name="break" />
              <FTB:ToolbarItem Name="DeleteTableColumn" />
              <FTB:ToolbarItem Name="DeleteTableRow" />
              <FTB:ToolbarItem Name="MergeCells" />
              <FTB:ToolbarItem Name="SplitCell" />
         </FTB:ToolbarGroup>
         <FTB:ToolbarGroup Title="CSS">
              <FTB:ToolbarItem Name="CssClass" />
              <FTB:ToolbarItem Name="EditCssProperties" />
              <FTB:ToolbarItem Name="WordClean" />
              <FTB:ToolbarItem Name="break" />
              <FTB:ToolbarItem Name="CssClassList" >
                   <FTB:ToolbarListItem Text="<span class='sampleClass'>Sample Class</span>" Value="sampleClass" />
              </FTB:ToolbarItem>
         </FTB:ToolbarGroup>
         <FTB:ToolbarGroup Title="Insert">
              <FTB:ToolbarItem Name="InsertRule" />
              <FTB:ToolbarItem Name="InsertImage" />
              <FTB:ToolbarItem Name="CreateLink" />
              <FTB:ToolbarItem Name="Unlink" />
              <FTB:ToolbarItem Name="break" />
              <FTB:ToolbarItem Name="InsertHtmlMenu">
                   <FTB:ToolbarListItem Value="<b>some bold text</b>" Text="<b>bold text</b>" />                   <FTB:ToolbarListItem Value="<b>some italic text</b>" Text="<i>italic text</i>" />              </FTB:ToolbarItem>
         </FTB:ToolbarGroup>
</FTB:FreeTextBox>(这句不用输入)
<FTB:Floatie
ID="Floatie1" TargetEditor="FreeTextBox1" runat="SErver">
     <FTB:ToolbarGroup >
         <FTB:ToolbarItem Name="ParagraphMenu" />
         <FTB:ToolbarItem Name="BulletedList" />
         <FTB:ToolbarItem Name="NumberedList" />
         <FTB:ToolbarItem Name="break" />
         <FTB:ToolbarItem Name="CreateLink" />
         <FTB:ToolbarItem Name="Bold" />
         <FTB:ToolbarItem Name="Italic" />
         <FTB:ToolbarItem Name="Underline" />
         <FTB:ToolbarItem Name="Strikethrough" />
         <FTB:ToolbarItem Name="separator" />
         <FTB:ToolbarItem Name="Superscript" />
         <FTB:ToolbarItem Name="Subscript" />
     </FTB:ToolbarGroup>Bold 加粗
BulletedList 项目符号
Copy 复制
CreateLink 插入链接
Cut   剪切
Delete 删除
DeleteTableColumn 删除一列(En)
DeleteTableRow 删除一行(En)
IeSpellCheck IE拼写检查(En 需要安装拼写检查软件)
Indent 增加缩进
InsertDate 插入日期
InsertImage 插入图片
InsertRule 插入水平线(En)
InsertTable 插入表格(En)
InsertTableColumnAfter 插入表格列在后面(En)
InsertTableColumnBefore 插入表格列在前面(En)
InsertTableRowAfter 插入表格行在后面(En)
InsertTableRowBefore 插入表格行在前面(En)
InsertTime 插入时间
Italic 斜体
JustifyCenter 居中
JustifyFull 两端对齐
JustifyLeft 左对齐
JustifyRight 右对齐
NetSpell 网络拼写检查(En)
NumberedList 编号
Outdent 减少缩进
Paste 粘贴
Print 打印
Redo 重复
RemoveFormat 删除所有格式
Save 保存(En)
StrikeThrough 删除线
SubScript 下标
SuperScript 上标
Underline 下划线
Undo 撤消
Unlink 删除链接

</FTB:Floatie>

下面是工具栏按钮的具体解释:

 

五、将输入的结果存储到数据库中

创建Sql Server数据库表 NEWS,其中包括一个Neirong字段nText类型。

在页面上添加一个命令按钮,命名为【提交】。在【提交】按钮的单击事件中添加代码。

添加引用:Using System.Data.SqlClient;

protected void Button1_Click(object sender, EventArgs e)//【提交按钮】
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
        SqlCommand com = new SqlCommand("Insert into News(neirong) values(@neirong)", con);
        con.Open();
        com.Parameters.AddWithValue("@neirong", FreeTextBox1.Text);
        com.ExecuteNonQuery();
        con.Close();
    }

六、显示Neirong字段中的内容

新建一个页面,添加一个Label1标签,在Load事件中添加读取数据库信息的代码

Using System.Data.SqlClient;

protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection con=new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
        SqlCommand com=new SqlCommand("select neirong from news where id=1",con);
        con.Open();
        SqlDataReader dr=com.ExecuteReader();
        if (dr.Read())
        {
              Label1.Text = dr["neirong"].ToString();
        }
        con.Close();
   }
这样就能够显示出在FreeTextBox控件中输入的内容。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
FreeTextBox3.2.2简体中文示例源码 FreeTextBox是一款免费的Asp.net网页编辑器,官方默认为英文,该本设置为简体中文,可以设置文字样式、在线排、图片上传等(FreeTextBox源码需要单独购买授权),该代码包括了各类应用的演示和实现过程 包括:功能设置、下拉显示、多语言(包括简体中文、繁体、英文等)切换、JS调用、WebParts应用、Ajax无刷新交互、 直接使用方法: (1) 复制 bin 目录下的 FreeTextBox.dll 文件到你的 Web 应用程序目录中的 bin 目录; (2) 复制 HelperScripts 目录下的三个文件到你的 Web 应用程序目录中或其子目录中,注意使用时要指定 HelperFilePath 属性; 假设把三个文件放于应用程序下的 helpfile 目录:this.FreeTextBox1.HelperFilesPath="helpfile"; 即指向了此目录。 (3) 复制 images 目录下的 ftb 目录到你的 Web 站点根目录下的 images 目录中。 此目录中包含界面的各种皮肤图片 (4) 在应用程序目录下建立images目录,此目录用于上传图片的图片库,必须有,否则插入图片将不可用 (5) 使用:在应用程序中建立相应的WEB窗体 在HTML代码页 页头添加<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %> 引入控件标签 复制<FTB:FreeTextBox id="FreeTextBox1" runat="server" Width="500px" Height="400px" />到页面中需要的位置 也可以把控件添加到工具栏,通过直接拖拽来使用控件 文件夹下有Asp.net1.1/2.0/3.5各个环境下可以使用FreeTextBox.dll
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值