We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

LoadFromString and CSS

Thread ID:

Created:

Updated:

Platform:

Replies:

32504 Aug 2,2005 04:05 PM UTC Aug 26,2005 09:12 PM UTC WinForms 4
loading
Tags: HTMLUIControl
Chuck Cherry
Asked On August 2, 2005 04:05 PM UTC

I''m trying to apply styles to some HTML that I load from a string, but its not working. What am I doing wrong? The CSS file loads ok, so I am assuming there is something wrong in the way I am trying to do this. Here is a sample code fragment: Dim strHTMLText As New StringBuilder With strHTMLText .Append("") .Append("
This is a sample heading
") .Append("
This is a sample div.
") .Append("
This is another sample div.
") .Append("") End With htmlMessages.LoadFromString(strHTMLText.ToString) htmlMessages.LoadCSS("styles.css")

Chuck Cherry
Replied On August 2, 2005 04:06 PM UTC

OK, apparently the html tags in the previous post were stripped out, but they were there in the original... >I''m trying to apply styles to some HTML that I load from a string, but its not working. What am I doing wrong? The CSS file loads ok, so I am assuming there is something wrong in the way I am trying to do this. > >Here is a sample code fragment: > >Dim strHTMLText As New StringBuilder >With strHTMLText > .Append("") > .Append("
This is a sample heading
") > .Append("
This is a sample div.
") > .Append("
This is another sample div.
") > .Append("") >End With >htmlMessages.LoadFromString(strHTMLText.ToString) >htmlMessages.LoadCSS("styles.css") >

Administrator [Syncfusion]
Replied On August 3, 2005 08:56 PM UTC

Hi Charles, The CSS should be applied if it is loaded after the string has been loaded and from the code snippet you have posted, you are doing ir correctly. It would help if you post the CSS file you are using. I have linked to a sample application that loads CSS and loads HTML from a string: http://www.syncfusion.com/support/user/Uploads/F32504_HTMLUICSSLoadVB_6983.zip Please try this sample at your end also upload your CSS file so that I can take a look at it. Thanks, Davis

Carsten Pedersen
Replied On August 25, 2005 06:52 AM UTC

I''m trying the same in C# using your css file, and it does not work, please help? public Form1() { InitializeComponent(); htmluiControl1.ShowTitle = false; string elementText = "LoadCSS

This is a paragraph

"; this.htmluiControl1.LoadFromString(elementText); this.htmluiControl1.LoadCSS("style.css"); }

Administrator [Syncfusion]
Replied On August 26, 2005 09:12 PM UTC

Hi, What is the version of HTMLUI you are using. This has been fixed in version 3.3.0.0 I have created an incident under your account in DirectTrac and posted a link to download version 3.3.0.0 along with the key. Thanks, Davis

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;