This is a migrated thread and some comments may be shown as answers.

An error has occurred while processing HtmlTextBox 'txtGroup_11': 'EN-AU' is an unexpected token. The expected token is '"' or '''.

2 Answers 394 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
RkW
Top achievements
Rank 1
RkW asked on 22 Feb 2012, 06:13 AM
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 = new Telerik.Reporting.HtmlTextBox();
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....

2 Answers, 1 is accepted

Sort by
0
RkW
Top achievements
Rank 1
answered on 24 Feb 2012, 12:02 AM
Can someone please give me a solution?
0
Milen | Product Manager @DX
Telerik team
answered on 24 Feb 2012, 05:04 PM
Hi Rak,

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:
=StripHtmlTags("Hi <b>John</b>")

will result in the plain text:
Hi John

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.

Kind regards,
Milen
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
Tags
General Discussions
Asked by
RkW
Top achievements
Rank 1
Answers by
RkW
Top achievements
Rank 1
Milen | Product Manager @DX
Telerik team
Share this question
or