This is a migrated thread and some comments may be shown as answers.

HtmlSource renders differently than SourceUrl

7 Answers 83 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Travis
Top achievements
Rank 1
Travis asked on 07 Sep 2010, 06:06 PM
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>

7 Answers, 1 is accepted

Sort by
0
Miro Miroslavov
Telerik team
answered on 13 Sep 2010, 08:06 AM
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
0
Stanescu Mihai
Top achievements
Rank 1
answered on 22 Sep 2010, 03:28 PM
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.
0
Miro Miroslavov
Telerik team
answered on 28 Sep 2010, 09:20 AM
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
0
Shiv
Top achievements
Rank 1
answered on 11 May 2012, 08:53 PM
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
0
Petar Mladenov
Telerik team
answered on 16 May 2012, 08:49 AM
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 >>

0
Subrajit
Top achievements
Rank 1
answered on 21 May 2012, 12:25 PM
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.
0
Petar Mladenov
Telerik team
answered on 24 May 2012, 07:03 AM
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 >>

Tags
HTMLPlaceHolder
Asked by
Travis
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Stanescu Mihai
Top achievements
Rank 1
Shiv
Top achievements
Rank 1
Petar Mladenov
Telerik team
Subrajit
Top achievements
Rank 1
Share this question
or