strip the special characters from dynamic columns with HTMLTextBox

4 posts, 0 answers
  1. Jonam
    Jonam avatar
    36 posts
    Member since:
    Jul 2010

    Posted 25 Nov 2010 Link to this post


    textBoxTable = new Telerik.Reporting.HtmlTextBox();
                    textBoxTable.Style.BorderColor.Default = Color.Black;
                    textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
                    textBoxTable.Value = "=Fields." + dc.ColumnName;

    i create dynamic columns with the code above. But when the value of a row has the '&' character it displays the error. "Error occured while processing HTMLTextBox". How can i avoid this error without changing the values that are stored in the database from & to &.

    greetings Jonam
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 25 Nov 2010 Link to this post

    Hello Jonam,

    Your question has already been answered in the other forum thread you've posted to.

    Sincerely yours,
    Steve
    the Telerik team
    Get started with Telerik Reporting with numerous videos and detailed documentation.
  3. DevCraft banner
  4. AkAlan
    AkAlan avatar
    121 posts
    Member since:
    Jun 2009

    Posted 28 Feb 2011 Link to this post

    I'm having the same issue. Could you at least add the referenced post to this one.
  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 01 Mar 2011 Link to this post

    Hello AkAlan,

    This is expected behavior. As outlined in the HtmlTextBox help article, we expect valid XHTML, and the "&" character is considered special (markup delimiter), so it needs to be encoded in order to be treated as regular text (the "&" character can be escaped with the "&" entity). It is good idea to do this in your data, as otherwise you would have to parse the data in your code, which is not recommended. Check the XHTML Validation help article elaborates on how you can handle exceptions caused by invalid XHTML.

    Best wishes,
    Steve
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top