I have a value with format: <div> Hello world! Just bonus some special chars: < > & ! </div>
Expected result: Hello world! Just bonus some special chars: < > & !
I've tried to use the HtmlEncode but it displays as "<div> Hello world! Just bonus some special chars: < > & ! </div>"
Can you guys support this issue?
Using Telerik Report Designer and programming language C#
4 Answers, 1 is accepted
It has been resolved.
[Definition: Entity and character references may both be used to escape the left angle bracket, ampersand, and other delimiters. A set of general entities (amp, lt, gt, apos, quot) is specified for this purpose. Numeric character references may also be used; they are expanded immediately when recognized and must be treated as character data, so the numeric character references " < " and " & " may be used to escape < and & when they occur in character data.]
All XML processors must recognize these entities whether they are declared or not. For interoperability, valid XML documents should declare these entities, like any others, before using them. If the entities lt or amp are declared, they must be declared as internal entities whose replacement text is a character reference to the respective character (less-than sign or ampersand) being escaped; the double escaping is required for these entities so that references to them produce a well-formed result. If the entities gt, apos, or quot are declared, they must be declared as internal entities whose replacement text is the single character being escaped (or a character reference to that character; the double escaping here is optional but harmless). For example:
<!ENTITY lt "&#60;">
<!ENTITY gt ">">
<!ENTITY amp "&#38;">
<!ENTITY apos "'">
<!ENTITY quot """>
Refer to https://www.w3.org/TR/REC-xml/#dt-escape
When it comes to &, you test using & I would suggest taking a look at this w3.org page which lists all special entities like "?" and TAB and their expression that should be used in the HtmlTextBox.
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Firstly, thanks for your answer.
I've tried to use & but it didn't work for me. So that why I've tried to use &