最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
.net控件FreeTextBox使用方法
时间:2022-07-02 11:54:15 编辑:袖梨 来源:一聚教程网
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.写入数据库
在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");
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.写入数据库
在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");
相关文章
- 《光与影 33号远征队》周年纪念销售数据更新 05-13
- 《光与影 33号远征队》的结局是这款RPG最精彩的部分 05-13
- 异环自选S级角色推荐 05-13
- 唐门技能攻略(唐门技能攻略详解,助你成为顶级强者) 05-13
- 她收藏的稀有宝可梦传说 阿尔宙斯卡牌数量史无前例 引发了广泛关注 05-13
- 据报道 早期玩家认为 Fairgames 试玩体验“乏味” 05-13