Episerver: property renders html of XHTML property

Vote:
 

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?

#39884
Jun 04, 2010 11:50
Vote:
 

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?

#40168
Jun 10, 2010 15:21
Vote:
 

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.

#40186
Jun 11, 2010 11:08
Vote:
 

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

#40188
Jun 11, 2010 11:51
Vote:
 

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.

#40190
Jun 11, 2010 12:12
Vote:
 

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): &lt;h3&gt;hello world&lt;/h3&gt;

Output of XHTMLString (View Source): <p>&lt;h3&gt;hello world&lt;/h3&gt;</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! 

Thanks.

#40192
Jun 11, 2010 12:45
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.