[网络收集]FreeTextBox 4.0 版控件的使用方法
2010-11-12 21:24
363 查看
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控件中输入的内容
摘自http://hi.baidu.com/luluboy6868/blog/item/00375801dfe489dd277fb5c3.html
一、下载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控件中输入的内容
摘自http://hi.baidu.com/luluboy6868/blog/item/00375801dfe489dd277fb5c3.html
相关文章推荐
- FreeTextBox 控件在.net中的使用方法收集(转)zzmdegm
- [网络收集]FreeTextBox在ASP.NET下的使用方法
- [网络收集]解决在母版页中使用Page.FindControl方法找不到指定控件的问题
- android学习笔记---44_在线视频播放器,网络视频解析器,SurfaceView 控件使用方法
- [网络收集]dropdownlist绑定的二种方法及 在gridview等控件中绑定dropdownlist的简单方法
- 播放视频android学习笔记---44_在线视频播放器,网络视频解析器,SurfaceView 控件使用方法
- 个人收集的Dev控件使用方法
- [第三方]SCNetworkReachability 获取网络状态控件使用方法
- [网络收集]ASP.NET两种办法给DropDownList绑定SqlDataReader 及在gridview等控件中绑定dropdownlist的简单方法
- [网络收集]控件使用之——Repeater C# 分页用法
- emWin使用资料收集(一) ----- emWin 2天速成实例教程008_IconView图标控件使用方法
- android学习笔记---44_在线视频播放器,网络视频解析器,SurfaceView 控件使用方法
- swift常用UI控件的使用方法
- Windows Phone 7 网络编程之WebBrowser控件的使用
- C#各种验证控件的使用方法
- 在xml布局文件中,我们既可以设置px,也可以设置dp(或者dip)。一般情况下,我们都会选择使用dp,这样可以保证不同屏幕分辨率的机器上布局一致。但是在代码中,如何处理呢?很多控件的方法中都只提供了
- 网络GHOST使用方法
- 客户端TortoiseSVN的安装及使用方法 (申明:来源于网络)
- WebBrowser(超文本浏览框)控件默认使用IE9,IE10的方法