HTML Conversion/Cleaning/Corruption

Last post 04-08-2014, 9:21 AM by rhonsberger. 6 replies.
Sort Posts: Previous Next
  •  04-02-2014, 11:27 AM 80199

    HTML Conversion/Cleaning/Corruption

    I have html code that when programatically set to the control text property results in corrupt and invalid html and is not rendered.  The same code, when pasted into the control works fine.  How do I disable whatever the control is doing to clean or modify code set in the text property?  

     

    Here is the code.:  http://www.selltis.com/corruptionissue.zip 

     

    Thanks,

    Rick 

  •  04-03-2014, 9:29 AM 80207 in reply to 80199

    Re: HTML Conversion/Cleaning/Corruption

    Hi rhonsberger,

     

    Try load your html file directly for the editor, it should work.

     

      protected override void OnLoad(EventArgs e)

             {

                 Editor1.LoadHtml("~/actual.htm");

                 base.OnLoad(e);

             } 

     

    Regards,

     

    ken 

  •  04-03-2014, 9:40 AM 80208 in reply to 80207

    Re: HTML Conversion/Cleaning/Corruption

    It does not work, nor is this practical because I have a string value from IMAP, not a file.
  •  04-04-2014, 8:27 AM 80220 in reply to 80208

    Re: HTML Conversion/Cleaning/Corruption

    Hi rhonsberger,

     

    Can you provide the full string what you are testing?

     

    Regards,

     

    Ken 

  •  04-04-2014, 9:53 AM 80225 in reply to 80220

    Re: HTML Conversion/Cleaning/Corruption

    The html code is provided via a link in the first message of this thread:

     

    Here is the code.:  http://www.selltis.com/corruptionissue.zip  

  •  04-07-2014, 3:56 AM 80228 in reply to 80225

    Re: HTML Conversion/Cleaning/Corruption

    Hi rhonsberger,

     

     

    I used the way below to load your htm file programmatically for the editor Text property, it shows correct. can you try it too?

     

    1. <%@ Page Language="c#" ValidateRequest="false" %>  
    2.   
    3. <%@ Register TagPrefix="RTE" Namespace="RTE" Assembly="RichTextEditor" %>  
    4.   
    5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    6. <html xmlns="http://www.w3.org/1999/xhtml">  
    7. <head>  
    8.     <script runat="server">  
    9.         public string ReadTextFileDate()  
    10.         {  
    11.             string strInput = "";  
    12.             string GetStream = "";  
    13.             string filePath = Server.MapPath("~/actual.htm");  
    14.             if (System.IO.File.Exists(filePath))  
    15.             {  
    16.                 System.IO.StreamReader sr = new System.IO.StreamReader(filePath, UnicodeEncoding.GetEncoding("utf-8"));  
    17.                 strInput = sr.ReadLine();  
    18.                 while (strInput != null)  
    19.                 {  
    20.                     GetStream += strInput;  
    21.                     strInput = sr.ReadLine();  
    22.                 }  
    23.                 sr.Close();  
    24.             }  
    25.             return GetStream;  
    26.         }  
    27.         protected override void OnLoad(EventArgs e)  
    28.         {  
    29.             Editor1.Text = ReadTextFileDate();  
    30.             base.OnLoad(e);  
    31.         }  
    32.     </script>  
    33. </head>  
    34. <body>  
    35.     <form id="Form1" method="post" runat="server">  
    36.         <RTE:Editor ID="Editor1" runat="server"  EditCompleteDocument="true" />  
    37.     </form>  
    38. </body>  
    39. </html>  
     

    Regards,

     

    Ken 

  •  04-08-2014, 9:21 AM 80236 in reply to 80228

    Re: HTML Conversion/Cleaning/Corruption

     I'm still getting converted and thus corrupted code.  

     

    Update:  Took the latest download and it works correctly now.

     

    Thanks,

    Rick 

View as RSS news feed in XML