Answered by:
Feeding HTML back to oBout Editor control

Question
-
User1196439756 posted
Hello all!
I am currently using obout's html editor control to which feeds the html content into a table. I am trying to create an edit page where it does the opposite and feeds the html contained in the table back to the editor, but the editor is only getting part of the code back...
For example:
This is the code contained in the table:
This is the home page!<br /><br /><p style="margin: 0px; text-align: center"><span style="font-weight: bold">Welcome to Conroe ISD</span></p>
and this is what the editor gets back
This is the home page!<br /> <br /> Welcome to Conroe ISD<br />
It totally skips the paragraph and span tags...
Here is the code behind:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then If Request.QueryString("pageid") Is Nothing Then HTMLContent.Text = "Sorry the page you are looking for could not be found.<BR>" Editor1.Visible = False Else Editor1.Visible = True Dim queryString As String = "SELECT HTML FROM MyTable WHERE (ID = " & Request.QueryString("pageid") & ")" Using connection As New SqlConnection("MyConnectionString") connection.Open() Dim command As New SqlCommand(queryString, connection) command.CommandTimeout = 999999 Dim reader As SqlDataReader = command.ExecuteReader() 'Checks to see if any records exist If reader.HasRows Then While reader.Read() If Not reader("HTML") Is DBNull.Value Then Dim text As String = reader("HTML") Editor1.Content = reader("HTML") End If End While Else HTMLContent.Text = "Sorry the page you are looking for could not be found.<BR>" Editor1.Visible = False End If reader.Close() connection.Close() End Using End If End If End Sub
And here is the page:<%@ Page Language="VB" AutoEventWireup="false" CodeFile="testEditor.aspx.vb" Inherits="testEditor" %> <%@ Register Assembly="obout_Editor" Namespace="OboutInc.Editor" TagPrefix="obout" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <asp:Literal ID="HTMLContent" runat="server"></asp:Literal> <obout:Editor ID="Editor1" runat="server" Appearance="custom" FixedToolBar="False" PreviewMode="True" ShowQuickFormat="False" Height="500" Width="808" InitialCleanUp="True" Cancel="True" ModeHTML="False" ModeSwitch="True" CallbackContent="True"> <DefaultTable Width="100" WidthUnit="percent" /> <Buttons> <obout:Toggle Name="Bold" /> <obout:Toggle Name="Italic" /> <obout:Toggle Name="Underline" /> <obout:Toggle Name="StrikeThrough" /> <obout:Select Name="FontSize" /> <obout:HorizontalSeparator /> <obout:VerticalSeparator /> <obout:Method Name="ForeColor" /> <obout:Method Name="ForeColorClear" /> <obout:Method Name="Undo" /> <obout:Method Name="Redo" /> <obout:Method Name="ClearStyles" /> <obout:Method Name="Cut" /> <obout:Method Name="Copy" /> <obout:Method Name="Paste" /> <obout:Method Name="PasteText" /> <obout:Method Name="JustifyLeft" /> <obout:Method Name="JustifyCenter" /> <obout:Method Name="JustifyRight" /> <obout:Method Name="OrderedList" /> <obout:Method Name="BulletedList" /> <obout:Method Name="DecreaseIndent" /> <obout:Method Name="IncreaseIndent" /> <obout:Method Name="CreateLink" /> <obout:Method Name="InsertTable" /> <obout:Method Name="InsertHR" /> <obout:Method Name="InsertIMG" /> <obout:Method Name="ToUpperCase" /> <obout:Method Name="ToLowerCase" /> <obout:Method Name="RemoveAlignment" /> <obout:Method Name="JustifyFull" /> <obout:Method Name="SelectAll" /> <obout:Method Name="SelectNone" /> <obout:Method Name="SpellCheck" /> <obout:Method Name="Preview" /> <obout:Method Name="DecreaseHeight" /> <obout:Method Name="IncreaseHeight" /> <obout:Method Name="InsertFlash" /> <obout:Method Name="InsertMedia" /> <obout:Method Name="Paragraph" /> </Buttons> </obout:Editor> </form> </body> </html>
Any ideas why it is removing those html tags? I have also tried to encode and decode and had no luck...
Wednesday, June 24, 2009 5:15 PM
Answers
-
User-382531957 posted
I've solved the problem by removing InitialCleanUp="True".
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, May 19, 2010 12:51 AM
All replies
-
User261842408 posted
Did you resolve this? I'm attempting to do the same thing.
Thanks,
JC
Wednesday, September 2, 2009 4:30 PM -
User1196439756 posted
No we never found a solution with oBout Editor
Thursday, November 5, 2009 9:59 AM -
User261842408 posted
FYI - I wound up purchasing support from Obout to solve another problem, and also discussed this issue. They have built a solution which is part of the downloadable file. I haven't tried it yet. If anyone has, I'd be curious to know what they think.
Thursday, February 4, 2010 2:20 PM -
User-382531957 posted
I am also facing the same problem, have you solved it yet?
Tuesday, May 18, 2010 6:21 AM -
User261842408 posted
I solved this by tying the Editor to a database and used 2 pages - 1 for editing and 1 for all viewers. It works.
PageID PageName EditorFieldData
fyi - Obout now has a "Solutions" module to manage web pages, though I have been able to get it to work yet.
Tuesday, May 18, 2010 4:12 PM -
User-382531957 posted
I've solved the problem by removing InitialCleanUp="True".
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, May 19, 2010 12:51 AM