Inserting gibberish into database (Using Dreamweaver MX8 .NET C#)

  •  04-11-2006, 11:00 AM

    Inserting gibberish into database (Using Dreamweaver MX8 .NET C#)

    I am trying to add the HTML generated by CuteEditor into a MS SQL database, but the code inserted is gibberish (stuff like: Thi#7 i#7 th#9 #1b#2#1f#5nt c#5l#5r="#0ff7320"#2b#5dy#1/f#5nt#2#1/b#2#1br#2)

    I am using Dreamweaver ASP.NET C#

    Here is a sample code (could you please let me know what I need to change and where (a previous reponse to a similar question hasn't helped at all, as I am not sure where the code suggested goes)).

    <%@ Page Language="C#" ContentType="text/html" ResponseEncoding="UTF-8" %>

    <%@ Import Namespace="System.Data" %>

    <%@ Import Namespace="System.Data.OleDb" %>

    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>

    <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>

    <MM:Insert

    runat="server"

    CommandText='<%# "INSERT INTO Site.tbl_NewsItem (NewsItemBody) VALUES (@NewsItemBody)" %>'

    ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_connXXXX"] %>'

    DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_connXXXX"] %>'

    Expression='<%# Request.Form["MM_insert"] == "form1" %>'

    CreateDataSet="false"

    SuccessURL='<%# "/cs/testeditor.aspx" %>'

    Debug="true"

    >

      <Parameters>

        <Parameter Name="@NewsItemBody" Value='<%# ((Request.Form["NewsItemBody"] != null) && (Request.Form["NewsItemBody"].Length > 0)) ? Request.Form["NewsItemBody"] : "" %>' Type="NVarChar" />

      </Parameters>

    </MM:Insert>


    <HTML>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <HEAD>


    <TITLE>TEST</TITLE>


    </HEAD>

    <BODY>

    <FORM name="form1" id="form1" runat="server">

    <table align="center">

        <tr valign="baseline">

          <td nowrap align="right" valign="top">NewsItemBody:</td>

          <td><CE:Editor id="NewsItemBody" EditorWysiwygModeCss="../example.css" runat="server" ></CE:Editor></td>

        </tr>

        <tr valign="baseline">

          <td nowrap align="right">&nbsp;</td>

          <td><input type="submit" value="Insert record"></td>

        </tr>

      </table>

    <input type="hidden" name="MM_insert" value="form1">

    </FORM>

    </BODY>

    </HTML>

View Complete Thread