How to use the. net control FreeTextBox

Source: Internet
Author: User
1. Add freetextbox. dll to the project.
2. Set-ftb. colorpicker. aspx
-Ftb. imagegallery. aspx
-Ftb. inserttable. aspx
Copy it from the folder HelperScripts and put it in the directory of the same level as-test. aspx (test,
(If you do not do this, you cannot insert background colors, images, and tables)
3. Place the images folder in the directory test. aspx (test) of the same level to store uploaded images.
4. Add the image path to test. aspx.
<FTB: FreeTextBox id = "FreeTextBox1" runat = "server" Width = "700" ButtonPath = "imagesftboffice2003"/>
This. FreeTextBox1.Text is the content of the text you entered in FTB, which is marked with HTML.
This. FreeTextBox1.HtmlStrippedText: the text that removes the HTML tag.
5. Write data to the database
On CSDN, I saw my friends saying how to write FreeTextBox content into the database.
I just inserted all generated HTML code into a field in the database.
You can create a news table.
News
Field ID (auto-increment) 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 button#click (object sender, System. EventArgs e)
{
SqlConnection myConn = new SqlConnection ("server = (local); database = mm; uid = sa; pwd = 123 ");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.