posts - 116,  comments - 34,  trackbacks - 0
Freetextbox是一个免费的.net mshtml 编辑器。
我所用的免费的freetextbox版本是中文版本1.6.3的汉化的freetextbox。
获得的地址。http://www.percyboy.com/w/ftb/
下载之后仔细看看其中的说明,你就可以使用这个完美的编辑器。
其中示例是在内联代码方式下,如果在代码后置下使用Freetextbox 呢。
1、首先我们把 FreeTextBox.dll 文件copy到我们的项目中的bin目录里。
然后在我们的项目里添加新的引用,在添加引用对话框选择项目标签,浏览/选择你的FreeTextBox.dll/打开/确定。应用就添加完成了。

2、如何获得FreeTextBox.dll 中所使用到的名字空间,本中文版本1.6.3 有3个名字空间。
using FreeTextBoxControls;
using FreeTextBoxControls.Design;
using FreeTextBoxControls.Common;
可以在引用的FreeTextBox.dll 查看对象浏览。
点开树型目录就可以清晰的看到,上面所说的名字空间了。
其他的版本类似可以获得。
3、在aspx文件添加freetextbox
<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
具体的方法和内联一样的。
同时cs文件中会有如下代码:
protected FreeTextBoxControls.FreeTextBox FreeTextBox1;产生
添加完后,运行一下就可以看到结果了。
在设计模式下我们还可以查看FreeTextBox 属性。
4、如何把FreeTextBox 内容写到数据库,我们在aspx文件中添加一个bottom
其的onclick=“my_add"
cs文件
protected void my_add(object sender, System.EventArgs e)
        {
            // 在此处放置用户代码以初始化页面
         Response.Write(FreeTextBox1.Text);
        }
此处是输出内容,可以改成我们需要方法。

FreeTextBox使用方法集合

作者:刘一   时间:2005-6-16
 我在此网站http://www.percyboy.com/w/ftb/down/下载了
FreeTextBox 1.6.3 中文版 [307KB]
FreeTextBox 1.6.3 中文版源代码 [420KB]

1.先把freetextbox.dll添加到项目中

2.把 - ftb.colorpicker.aspx
          - ftb.imagegallery.aspx
          - ftb.inserttable.aspx
从文件夹HelperScripts复制出来,放到外面与 - test.aspx (测试)同等级目录,
(不这么做,插入背景色,图片,表格就不好使)

3.把images文件夹放到test.aspx (测试)同等级目录下,来存放上传的图片.

4.在test.aspx 中,加图片的路径
<FTB:FreeTextBox id="FreeTextBox1" runat="server" Width="700" ButtonPath="\images\ftb\office2003\"/>

this.FreeTextBox1.Text 这个就是FTB中你输入的文本的内容,这是带HTML标记的

this.FreeTextBox1.HtmlStrippedText 这个是将HTML标记去掉的文本

5.写入数据库
在CSDN上看到朋友们说怎么把FreeTextBox内容写入数据库中
我做了一下.就是把所有产生的HTML代码都插入数据库的一个字段中
可以做一个新闻表
news
字段ID(自增) content addtime(getdate)
 

 private void Page_Load(object sender, System.EventArgs e)
  {
   // Put user code to initialize the page here
   if (!IsPostBack)
   {
    SqlConnection myConn = new SqlConnection("server=(local);database=mm;uid=sa;pwd=123");
    SqlCommand myCmd = new SqlCommand("select * from test where id=2",myConn);
    myConn.Open();
    SqlDataReader myDr;
    myDr=myCmd.ExecuteReader();
    myDr.Read();
    Response.Write(myDr["content"].ToString());
    myDr.Close();
    myConn.Close();
   }
  }

 private void Button1_Click(object sender, System.EventArgs e)
  {
   SqlConnection myConn = new SqlConnection("server=(local);database=mm;uid=sa;pwd=123");
   SqlCommand myCmd = new SqlCommand("insert into test (content) values('"+FreeTextBox1.Text+"')",myConn);  
   myConn.Open();
             myCmd.ExecuteNonQuery();
   myConn.Close();
  }

[注]web.config
在system.web节加入:
  <pages validateRequest="false"/>

  -----------------------------------------------------------------------------------------------------
这里还有3.0的版本,不过是外文的哟!

FreeTextBox 3.0

The no.1 free ASP.NET HTML Editor for IE and Mozilla. 
 

FreeTextBox 3.0

FreeTextBox 3.0, with over 150,000 downloads, is the most popular cross-browser HTML editor for ASP.NET. To start using the control, do the following

  1. Download FreeTextBox 3.0.4
  2. Read FreeTextBox Wiki for installation instructions
  3. Report problems to the forums
  4. Purchase a Pro license ($49) or source code/distribution license ($199).

Current Version (3.0.4) Information

---------另外补上一文章-------------------------

 Freetextbox是一个免费的.net mshtml 编辑器。
我所用的免费的freetextbox版本是中文版本1.6.3的汉化的freetextbox。
获得的地址。http://www.percyboy.com/w/ftb/
下载之后仔细看看其中的说明,你就可以使用这个完美的编辑器。
其中示例是在内联代码方式下,如果在代码后置下使用Freetextbox 呢。
1、首先我们把 FreeTextBox.dll 文件copy到我们的项目中的bin目录里。
然后在我们的项目里添加新的引用,在添加引用对话框选择项目标签,浏览/选择你的FreeTextBox.dll/打开/确定。应用就添加完成了。

2、如何获得FreeTextBox.dll 中所使用到的名字空间,本中文版本1.6.3 有3个名字空间。
using FreeTextBoxControls;
using FreeTextBoxControls.Design;
using FreeTextBoxControls.Common;
可以在引用的FreeTextBox.dll 查看对象浏览。
点开树型目录就可以清晰的看到,上面所说的名字空间了。
其他的版本类似可以获得。
3、在aspx文件添加freetextbox
<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
具体的方法和内联一样的。
同时cs文件中会有如下代码:
protected FreeTextBoxControls.FreeTextBox FreeTextBox1;产生
添加完后,运行一下就可以看到结果了。
在设计模式下我们还可以查看FreeTextBox 属性。
4、如何把FreeTextBox 内容写到数据库,我们在aspx文件中添加一个bottom
其的onclick=“my_add"
cs文件
protected void my_add(object sender, System.EventArgs e)
        {
            // 在此处放置用户代码以初始化页面
         Response.Write(FreeTextBox1.Text);
        }
此处是输出内容,可以改成我们需要方法。

----心得-------------------------------------------------------

  在使用FreeTextBox控件进行文本编辑后,进行保存时需要取编辑内容对应的HTML文本内容。取编

辑内容使用my_freetextbox.ViewStateText属性会比使用my_freetextbox.Text属性,在后续的字

符串内容处理上会方便一些。

      在所取出的字符串中,系统自动加上了“\r\n”的回车换行字符串标示,在存储内容到数据库之前最

好将这些“\r\n”字符串用空串“”替换掉(如:my_str=my_str.Replace("\r\n","")),否则在将

来调用时会导致不正常显示。

      在所取出的字符串中,系统还把编辑文本中的双引号“用转义字符\进行了处理,如原字符串为

“wangshixin said "hello!"”,所取得的字符串实际为“wangshixin said \"hello!\"”,因此需要

将所获得的字符串中的全部“\"”用特定的字符串替换掉。在将来提取显示时,再将特定字符串替换为

“\"”(如:my_str=my_str.Replace("\"","wangshixin750920"))。

-----还有,再加上--------------------------------------------------------------------------
 

FreeTextBox1.Text 取得内容(带html标签的)

FreeTextBox1.HtmlStrippedText  也是取得内容(不带Html标签的)
------关于WORD中过来的内容,出错解决------------------------------------------------------------
 把从word复制的文本粘贴到freetextbox里,提交到数据库的时候会提示有危险代码,也就是单引号,这是为什么?
在Dottext里的freetextbox,同一篇word文档,提交时就没有问题。
我现在找到的原因是dottext里的freetextbox在提交的时候会把危险代码重新编码好像,而在我的项目里的freetextbox就不会。
查看包含freetextbox控件的页面源文件,又发现license不同,是不是有

把页面中的validateRequest指令设成false即可,或者直接改web.config:<pages validateRequest="false" buffer="true"/>
-----------------------------------

posted on 2006-01-06 17:17 萌芽的叶子 阅读(1999) 评论(4)  编辑 收藏 引用 所属分类: 控件

FeedBack:
# re: Freetextbox 的使用
2006-02-08 19:51 | 做喜欢做的事
好。  回复  更多评论
  
# re: Freetextbox 的使用
2006-03-26 18:31 | pp1883@163.com
你好,按你这样写的放到购买的别人的服务器上面怎么提示 配置错误


分析器错误信息: 访问被拒绝:“freetextbox”。

源错误:


行 256: <add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
行 257: <add assembly="System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
行 258: <add assembly="*"/>
行 259: </assemblies>
行 260:


源文件: c:\windows\microsoft.net\framework\v1.1.4322\Config\machine.config 行: 258   回复  更多评论
  
# re: Freetextbox 的使用
2006-04-12 14:50 | 萌芽的叶子
倒,我是转载的  回复  更多评论
  
# re: Freetextbox 的使用
2007-12-30 09:05 | sdgsdg
http://puttana-strada-bollate-it.sculaccia-tun.info
http://bill-ward-adult-gallery-fetish.sculaccia-tun.info
http://cerco-amante-donna-sesso.gradis-tun.info
http://sesso-femminile-poeno.gradis-tun.info
http://porno-amori-di-eva.fatte-tun.info
http://erotic-collant.sculaccia-tun.info
http://sesso-a-13-anni.sculaccia-tun.info
http://video-culo-aperto.sculaccia-tun.info
http://moglie-sesso-ricatto.sculaccia-tun.info
http://filmato-video-amatoriale-gratis.gradis-tun.info
http://nonna-video-hard.fatte-tun.info
http://porno-tube-welcome.sculaccia-tun.info
http://mature-teacher-sex.gradis-tun.info
http://fetish-leg.sculaccia-tun.info
http://professoressa-sesso-studente.gradis-tun.info
http://foto-gratis-del-pene.gradis-tun.info
http://mutandine-vip.gradis-tun.info
http://cazzo-nel-culo-video.fatte-tun.info
http://video-racconto-porno-gratis.gradis-tun.info
http://avere-un-seno-piu-grande.sculaccia-tun.info
http://sexy-nurses-2.sculaccia-tun.info
http://sesso-ripreso-telefonino.gradis-tun.info
http://ciat-casalinga-porno.gradis-tun.info
http://film-porno-123.fatte-tun.info
http://sega-piede-ragazza-rumena.fatte-tun.info
http://grassa-troia-matura.sculaccia-tun.info
http://sesso-al-telefono-donna.fatte-tun.info
http://cazzi-gonfi-gratis.gradis-tun.info
http://manga-hentai-xxx-gratis.sculaccia-tun.info
http://dito-culo-mosana-pozzo.fatte-tun.info
http://dvd-explorer-porno-codice.fatte-tun.info
http://ragazza-incontro-sesso-avezzano.gradis-tun.info
http://annuncio-incontro-donna-lecce.gradis-tun.info  回复  更多评论
  
只有注册用户登录后才能发表评论。

<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿(3)

随笔分类(115)

随笔档案(116)

文章分类(4)

相册

收藏夹(78)

.net中文社区

.net博客

.net英文社区

AJAX

ASP.NET 2.0

ASP.NET 学习

DataBase

ERP

E杂志

Html&Css

JavaScript

Microsoft

Open Sourse

SAP

WebCasts

WebServices

XML

其他

好友Blog

好文章连接

开发工具

控件

物流

职业经理人

设计模式

读书网站

非技术

项目管理

搜索

  •  

积分与排名

  • 积分 - 57015
  • 排名 - 107

最新评论

阅读排行榜

评论排行榜