zoukankan      html  css  js  c++  java
  • .net控件FreeTextBox使用方法

    Freetextbox是一个免费的.net mshtml 编辑器。ITPUB个人空间Bt1nqhr"Ib
    我所用的免费的freetextbox版本是中文版本1.6.3的汉化的freetextbox。ITPUB个人空间Lp$bT:u(kW-]{
    获得的地址。http://www.percyboy.com/w/ftb/
    s|,X%QA+l#[:e0下载之后仔细看看其中的说明,你就可以使用这个完美的编辑器。
    ?#k$gTS0其中示例是在内联代码方式下,如果在代码后置下使用Freetextbox 呢。
    ,Cw/k0V)d*H0N#Vp%F4y01、首先我们把 FreeTextBox.dll 文件copy到我们的项目中的bin目录里。ITPUB个人空间+x/Di/W3O} m;BTB
    然后在我们的项目里添加新的引用,在添加引用对话框选择项目标签,浏览/选择你的FreeTextBox.dll/打开/确定。应用就添加完成了。
    P%q.Z;swb~)F0
    qeS+DN)x0[02、如何获得FreeTextBox.dll 中所使用到的名字空间,本中文版本1.6.3 有3个名字空间。
    k#v6E)}S;]1W0using FreeTextBoxControls;
    using FreeTextBoxControls.Design;
    using FreeTextBoxControls.Common;ITPUB个人空间R*O/d d1E
    可以在引用的FreeTextBox.dll 查看对象浏览。
    q:K/_ e O D?.bD0点开树型目录就可以清晰的看到,上面所说的名字空间了。ITPUB个人空间s{6T'm4g-_%Q:X4c
    其他的版本类似可以获得。
    @0N/vm(h*B03、在aspx文件添加freetextbox
    &GI+BaK Q%`0<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
    J*z{3A YKf0具体的方法和内联一样的。
    4D&_2P}3d2ij-a0同时cs文件中会有如下代码:
    protected FreeTextBoxControls.FreeTextBox FreeTextBox1;产生
    a+V0@k GZ)r}H0添加完后,运行一下就可以看到结果了。
    qR+s E2@0在设计模式下我们还可以查看FreeTextBox 属性。
    b KJ$b1@bo J)R04、如何把FreeTextBox 内容写到数据库,我们在aspx文件中添加一个bottomITPUB个人空间:J;a2i/|saC
    其的onclick=“my_add"ITPUB个人空间g:xzS+?9UN
    cs文件ITPUB个人空间&m4C7M6E5k{
    protected void my_add(object sender, System.EventArgs e)ITPUB个人空间'r:T,rQ[C[(?|I:ag
            {ITPUB个人空间7OL%D&s@%eJ
                // 在此处放置用户代码以初始化页面
               Response.Write(FreeTextBox1.Text);
      }
    此处是输出内容,可以改成我们需要方法。

    可以做一个新闻表

    news

    字段ID(自增)contentaddtime(getdate)
    privatevoidPage_Load(objectsender,System.EventArgse)
    {
    //Putusercodetoinitializethepagehere
    if(!IsPostBack)
    {
    SqlConnectionmyConn=newSqlConnection("server=(local);database=mm;uid=sa;pwd=123");
    SqlCommandmyCmd=newSqlCommand("select*fromtestwhereid=2",myConn);
    myConn.Open();
    SqlDataReadermyDr;
    myDr=myCmd.ExecuteReader();
    myDr.Read();
    Response.Write(myDr["content"].ToString());
    myDr.Close();
    myConn.Close();
    }
    }
    privatevoidButton1_Click(objectsender,System.EventArgse)
    {
    SqlConnectionmyConn=newSqlConnection("server=(local);database=mm;uid=sa;pwd=123");
    SqlCommandmyCmd=newSqlCommand("insertintotest(content)values('"+FreeTextBox1.Text+"')",myConn);
    myConn.Open();
    myCmd.ExecuteNonQuery();
    myConn.Close();
    }

    [注]web.config

    在system.web节加入:

    下载:

    http://www.percyboy.com/w/ftb/down/FTB_1.6.3_zh.zip

     

     

  • 相关阅读:
    poj 3322 不错的搜索题,想通了就很简单的。
    spoj 10649 镜子数的统计(正过来反过去一样)
    搜索第一题(poj 1190)蛋糕
    HashMap和Hashtable的区别
    ajax简单联动查询以及遇到的问题
    PHP之面向对象
    pg_bulkload快速加载数据
    WalMiner
    postgresWAL写放大优化
    postgresql创建统计信息优化
  • 原文地址:https://www.cnblogs.com/ly5201314/p/1293490.html
Copyright © 2011-2022 走看看