Posted 22 Feb 2012
Link to this post
I am getting above error when trying to assign below string to HtmlTextBox.
"question 1 (tips: <P><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-AU; mso-fareast-language: EN-US; mso-bidi-language: AR-SA" lang=EN-AU><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-AU; mso-fareast-language: EN-US; mso-bidi-language: AR-SA" lang=EN-AU>After this is</SPAN></SPAN></P>)"
Telerik.Reporting.HtmlTextBox txtBox =
txtBox.Value = value;
In the above code value
is equal to above string. How can I solve this error?
Also I want to know how to use StripHTMLTags
function. Or if there is any other way to remove HTML tags.
HtmlTextBox1.Value = StripHTMLTags(IncomingHTMLText);
Above doesn't work. It gives an error saying that StripHTMLTags
is not found.
Help would be appreciated....
Posted 24 Feb 2012
Link to this post
As stated in the help article HtmlTextBox - XHTML Validation you need to provide a valid XHTML for the value of our HtmlTextBox item. What does not comply with this rule in your code is the attribute lang=EN-AU where the value of the attribute is not surrounded in quotation marks. This is the cause of the error you receive: 'EN-AU' is an unexpected token. The expected token is '"' or '''. Line 1, position 228.
The function StripHtmlTags is a built-in function, part of our expression engine, which strips all html tags from its string argument, returning the plain text, the text nodes extracted from the given html.
For example the expresion:
will result in the plain text:
Note that the function may be only used as part of an expression, not in your compiled code.
More information and complete reference of all available built-in functions you may find in our help article Developer Reference - Functions.
the Telerik team