当前位置:编程学习 > C#/ASP.NET >>

freetextbox

为什么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:FreeTextBox ID="FreeTextBox1" runat="server" Height="282px" Width="723px" Theme="office12"     IsFullDocument="true" Language="zh-cn">
    
     <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>

具体解释:


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 删除链接

  

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

创建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控件中输入的内容
--------------------编程问答-------------------- 添加选择项 选你那个DLL
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,