Hi Filip,
Please try the suggestions from the report HTML within AspxNewsControl Content. The main idea is to set the control's EncodeHtml property to false.
Does this help?
Thanks,
Serge
--------------------
Check if Search Engine is able to answer questions faster than I do!
Hi Serge,
Thanks for the reply.
I got it working so far, except that ItemSettings.MaxLength doesn't work anymore when EncodeHTML is false?
Second thing I would really like is that the Popupcontrol (tail-click) also shows HTML. Although then content is filled with SetContentHTML(text), the content is still flat text.
(demo Newscontrol - Databinding).
Thanks,
Filip.
Hi Filip,
I'm not sure that I understand your requirements. However, if you want to insert
any HTML markup into the ASPxPopupControl's content on the client, you can call
the SetContentHTML method of the ASPxClientPopupControl and pass it your
markup. The markup won't be encoded, i.e. it will be treated as HTML. Here is
an example of using the SetContentHTML method that works fine:
<script type="text/javascript">
function OnButtonClick() {
popup.SetContentHTML('Hello, <strong style="color: red;">World</strong>!');
}
</script>
<dxpc:ASPxPopupControl ID="pcPopupControl" runat="server" ClientInstanceName="popup"
ShowOnPageLoad="True" CloseAction="CloseButton" Left="200" Top="200">
<ContentCollection>
<dxpc:PopupControlContentControl runat="server">
<input type="button" value="Set Content HTML" onclick="OnButtonClick();" />
</dxpc:PopupControlContentControl>
</ContentCollection>
</dxpc:ASPxPopupControl>
--
Victor
R&D
Hi,
What I mean is: in the ASPxperience demo - the Newscontrol-databinding demo - there is an ASPxNewControl controlled by an XML datasource: ~/App_Data/NewsControlRSS.xml and there is an ASPxPopupControl. The content of the PopupControl is filled with the content of a NewsControl item.
Two things:
1) if EncodeHtml = False in the NewsControl, the ItemSettings.MaxLength won't work
2) if I put some HTML tags in a description of the XML file (~/App_Data/NewsControlRSS.xml), the PopupControl won't show HTML.
Hope I made myself clear ;-)
Regards,
Filip.
Hi Filip,
Thank you for the clarification.
1) This is actually the designed limitation of our controls. When working in EncodeHtml=False mode, it's unclear how to cut the processed text. In particular, we don't know if it's necessary to treat the characters of HTML tags (e.g. <,b,>). If we process them as regular characters, the resulting string may split a tag in parts. From the other side, if we count only the characters inside HTML tags, there may be situations when the resulting string may lack a closing tag.
2) The XML file in this demo uses an XSLT transformation which automatically removes all HTML tags from nodes text. As a result, the XML DataSource provides a "pure" text without HTML tags. As a solution, you can store data in your XML file as HTML-encoded strings (where "<" is represented as "<", ">" as ">", "&" as "&", etc.). This way, the XML DataSource will provide a text with HTML tags. If you prefer this way, you can encode HTML tags using the HttpUtility.HtmlEncode method.
Does this make sense?
Regards,
Serge
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.
Facebook
Twitter
Google+