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

3 posts, 0 answers
  1. RkW
    RkW avatar
    6 posts
    Member since:
    Aug 2011

    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 = 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. RkW
    RkW avatar
    6 posts
    Member since:
    Aug 2011

    Posted 23 Feb 2012 Link to this post

    Can someone please give me a solution?

  3. Milen
    Admin
    Milen avatar
    161 posts
    Member since:
    Dec 2014

    Posted 24 Feb 2012 Link to this post

    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.

Back to Top