I have property of type XHtml string which contains bulleted list astext. I try to render it on a page using <Episerver:Property propetyname=".." .. />.
But it renders out the html text(<ul> <li> </li> </ul>) of the control rather than the bulleted list.
I have recently upgraded the project from Episerver 5.2 ( where it works fine ) to episerver 6.
Can you please suggest as to what needs to be done?
Look at the HTML -- what does it look like? Is is escaped with the HTML entities?
Do any other property controls on the page render in this way?
I had this issue a while back. I got around it by using the CurrentPage["MyPropertyName"] method instead as this doesn't HTML encode its output, it's 'literal'.
I made a simple control that encapsulates this and gives the option to HTML encode or not depending on how you want to use the property value.
I think a XHmtl property will render html as escaped html if there is none options selected to the editor field. If you have made your own editor and don't have set any options, then the EPiServer:Property will render escaped html
Correct, when using the string literal index (Currentpage["Myproperty"]), you also need to HTML encode (if you wish so). When using the EPiServer Property Control this is taken care of for you. Also, like Anders says, if you remove all options from the editor (disabling it), the raw value is outputted (not HTML encoded) when using the EPiServer Property Control.
Sorry if I miss understood your post Frederick & Anders, but I don't think that's entirely accurate.
If you use Long String property type to store <p>hello world</p> then the EPiServer Property Control shows the HTML tags on the page, showing that it does HTML encode the string. The same thing happens with the XHTML String property type, even with all the options switched off.
Even with all the options switched off, the XHTML property inserts paragraph tags for you. It seems that the XHTML property is going to treat any text you enter into it as content that needs to be displayed on the page and HTML encode it.
Output of LongString (View Source): <h3>hello world</h3>
Output of XHTMLString (View Source): <p><h3>hello world</h3></p>
Using CurrentPage["MyLongString"] seems to be the only way to display data exactly as you entered it into the long string field within the editor.
Again, I might be missing the point completely!