hahacjh
既然选择了远方 便只顾风雨兼程

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

2.把-ftb.colorpicker.aspx

-ftb.imagegallery.aspx

-ftb.inserttable.aspx

从文件夹HelperScripts复制出来,放到外面与-test.aspx(测试)同等级目录,

(不这么做,插入背景色,图片,表格就不好使)

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

4.在test.aspx中,加图片的路径

 

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

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

5.写入数据库

怎么把FreeTextBox内容写入数据库中

我做了一下.就是把所有产生的HTML代码都插入数据库的一个字段中

可以做一个新闻表

 

  1. private void Page_Load(object sender,System.Event Argse)  
  2. {  
  3. //Putusercodetoinitializethepagehere  
  4. if(!IsPostBack)  
  5. {  
  6. SqlConnection myConn=new SqlConnection("server=(local);database=mm;uid=sa;pwd=123");  
  7. SqlCommand myCmd=new SqlCommand("select*fromtestwhereid=2",myConn);  
  8. myConn.Open();  
  9. SqlDataReadermyDr;  
  10. myDr=myCmd.ExecuteReader();  
  11. myDr.Read();  
  12. Response.Write(myDr["content"].ToString());  
  13. myDr.Close();  
  14. myConn.Close();  
  15. }  
  16. }  
  17. private void Button1_Click(object sender,System.Event Argse)  
  18. {  
  19. SqlConnection myConn=newS qlConnection("server=(local);database=mm;uid=sa;pwd=123");  
  20. SqlCommand myCmd=new SqlCommand("insertintotest(content)values('"+FreeTextBox1.Text+"')",myConn);  
  21. myConn.Open();  
  22. myCmd.ExecuteNonQuery();  
  23. myConn.Close();  
  24. }  

转载自:http://blog.csdn.net/hyynet09/archive/2009/01/15/3789750.aspx

posted on 2010-07-15 21:57  hahacjh  阅读(165)  评论(0编辑  收藏  举报