title: How do I save text entered in a TinyEditor box to my database
body: <p>I am new to asp.net. Currently working on a form that uses tinyeditor to allow a user to input data. My question is, how can I get that HTML encoded text and save it to the database (Its MSSQL) upon pressing a button?</p>
  
  <pre><code>    &lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AboutMeEdit.aspx.cs" Inherits="InteractiveCV.AdminForms.AboutMeEdit" %&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head id="Head1" runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;style type="text/css"&gt;
          .auto-style1 {
              width: 100%;
          }
          .auto-style2 {
              height: 23px;
          }
      &lt;/style&gt;
      &lt;script src="../Scripts/tinyEditor/tiny.editor.packed.js"&gt;&lt;/script&gt;
      &lt;link href="../Styles/tinyeditor.css" rel="stylesheet" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
  
          &lt;table class="auto-style1"&gt;
              &lt;tr&gt;
                  &lt;td class="auto-style2"&gt;Edit Your About Me in the below Text Box&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
          &lt;asp:TextBox ID="tinyeditor" TextMode="MultiLine" Width="400" Height="200"  runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:RequiredFieldValidator ID="aboutmevalidate" runat="server" ControlToValidate="tinyeditor" ErrorMessage="About Me Left Empty"&gt;About Me Left Empty&lt;/asp:RequiredFieldValidator&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
  
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  &lt;script type="text/javascript"&gt;
      var editor = new TINY.editor.edit('editor', {
          id: 'tinyeditor',
          width: 584,
          height: 175,`enter code here`
          cssclass: 'tinyeditor',
          controlclass: 'tinyeditor-control',
          rowclass: 'tinyeditor-header',
          dividerclass: 'tinyeditor-divider',
          controls: ['bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|',
              'orderedlist', 'unorderedlist', '|', 'outdent', 'indent', '|', 'leftalign',
              'centeralign', 'rightalign', 'blockjustify', '|', 'unformat', '|', 'undo',        'redo', 'n',
              'font', 'size', 'style', '|', 'image', 'hr', 'link', 'unlink', '|', 'print'],
          footer: true,
          fonts: ['Verdana', 'Arial', 'Georgia', 'Trebuchet MS'],
          xhtml: true,
          cssfile: 'custom.css',
          bodyid: 'editor',
          footerclass: 'tinyeditor-footer',
          toggle: { text: 'source', activetext: 'code', cssclass: 'toggle' },
          resize: { cssclass: 'resize' }
      });
      &lt;/script&gt;
  </code></pre>
  
  <p>I have the following Codebehind:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Data.SqlClient;
  using System.Configuration;
  using System.Data;
  
  namespace InteractiveCV.AdminForms
  {
      public partial class AboutMeEdit : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
  
          }
  
          protected void Button1_Click(object sender, EventArgs e)
          {
              SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["RIADDConnectionString"].ConnectionString);
              SqlCommand cmd = new SqlCommand("INSERT INTO about_me (about_me) VALUES (@about_me)", conn);
              cmd.CommandType = CommandType.Text;
              cmd.Parameters.AddWithValue("@about_me",tinyeditor.Text);
              conn.Open();
              cmd.ExecuteNonQuery();
              conn.Close();
          }
  
          protected void tinyeditor_TextChanged(object sender, EventArgs e)
          {
  
          }
      }
  }
  </code></pre>