HtmlSource renders differently than SourceUrl

8 posts, 0 answers
  1. Travis
    Travis avatar
    223 posts
    Member since:
    Jan 2003

    Posted 07 Sep 2010 Link to this post

    I'm using the RadRichTextBox control to edit data and save it as HTML in my database.  I thought I would use the HTMLPlaceHolder to then display the data.  The problem is that certain style elements do not render properly when using HtmlSource.  I did discover that if I copy the HTML created by the RadRichTextBox and save it as an html page and then point the SourceUrl to that page that it will render correctly.  I'm assuming this is a bug, or perhaps I don't have some mysterious property set correctly in my HtmlPlaceHolder.  Below is an example of the HTML.  Should I be using a different control other than RadRichTextBox to edit HTML?

    Here's a bit more information I just noticed - it would seem that any style tags placed in the "<header>" tag are ignored, but if they are placed within the "<body>" tag, they are applied when using HtmlSource.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
      
      
    http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled</title><style type="text/css">
    .p_2F83C0B6 { margin: 0px 0px 12px 0px;text-align: lefttext-indent: 0pt;padding: 0px 0px 0px 0px; } 
    .s_68843F73 { font-family: 'Verdana';font-style: Normal;font-weight: normal;font-size: 13.33px;color: 
      
    #000000;background-color: #FFFFFF; } 
    .s_F0A06747 { font-family: 'Verdana';font-style: Italic;font-weight: bold;font-size: 13.33px;color: 
      
    #FF0000;background-color: #FFFFFF; } 
    </style></head><body><p class="p_2F83C0B6"><span class="s_68843F73">Testing </span><span class="s_F0A06747">Red 
      
    Text</span><span class="s_68843F73"> normal text</span></p></body></html>
  2. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 13 Sep 2010 Link to this post

    Hi Travis,

    There is a slight difference handling both properties internally. When you set SourceUrl - it is put into an iFrame with respective "scr". While when you set HtmlSource it is put into a div object over the silverlight control.
    This should give you some insights why it behaves differently. If you have any ideas or comments, please contact us.

    Best wishes,
    Miro Miroslavov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Stanescu Mihai
    Stanescu Mihai avatar
    33 posts
    Member since:
    Aug 2009

    Posted 22 Sep 2010 Link to this post

    So if I get this right, if you want to change the font-family or size etc., you have to specify it individually for each element if you use HtmlSource. I was trying to do this with an internal css class placed inside the head tag and was wondering why it did not work.
  5. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 28 Sep 2010 Link to this post

    Hello Stanescu Mihai,

     I'm not a html/css guru, but I guess that you are right. You should debug your html using some of the available web debugging tools and see how the styles are applied.
    If we can be of further help, please let us know.

    Regards,
    Miro Miroslavov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Shiv
    Shiv avatar
    9 posts
    Member since:
    Apr 2012

    Posted 11 May 2012 Link to this post

    Hi,
    I'm doing something similar.
    I'm getting the HTML from the radrichtextbox and trying to display it using radHTML place holder.
    But the HTMLplaceHolder is not showing the right formatting of the HTML.

    Can you help me in this regard? How should I get this to work.

    HTML from rad rich --> HTMLplaceHolder
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 16 May 2012 Link to this post

    Hi Shiv,

     You can try using the RadWindow instead of ChildWindow but this is shoot in the dark. Is it possible for you to send us an isolated sample that we can debug and check whether there is an issue in the RadRichTextBox or in the HtmlPlaceholder. Thank you in advance.

    Regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. Subrajit
    Subrajit avatar
    13 posts
    Member since:
    Jan 2012

    Posted 21 May 2012 Link to this post

    Hi Petar,
      I am facing the exact same problem, and I am using a RADWindow to display the content, and still it doesnt display the correct format. However, the issue seems to be occuring only in IE and not in either Chrome or Firefox.
  9. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 24 May 2012 Link to this post

    Hello Subrajit,

     Could you please check out this post and let us know if it helps you ? Thank you in advance.

    Greetings,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner