Javascript error if a span tag is in Node text

2 posts, 0 answers
  1. Tommy Walsh
    Tommy Walsh avatar
    7 posts
    Member since:
    Sep 2008

    Posted 10 Jun 2009 Link to this post


    I'm setting the node text on databind, with some HTML tags in the text. This has been no problem, except recently. If there are one or more <span> tags in the text, I get a javascript error on mouseover:

    Message: 'this._element' is null or not an object
    Line: 178
    Char: 1
    Code: 0
    URI: http://localhost:1360/ScriptResource.axd?d=DMsgcAGno5aOYK0aJwUvXdDJxcknSyeyRU4cG7Y7I2kuvLi_brGedLWr9i1aLqYyY_ZriuetXXzd7bzZtgAS4w2&t=633798049441157248

    If I remove the <span> tags, everything works flawlessly. Is there any way I can fix this without removing my span tags?

  2. Paul
    Paul avatar
    4281 posts

    Posted 10 Jun 2009 Link to this post

    Hi Tommy,

    Putting arbitrary HTML in the node's text may lead to invalid HTML since the text of the node is rendered in a SPAN tag. For example It is not permitted to render DIV within SPAN tags.

    On a side note you can use templates runtime. I suggest you check this help topic for more details. You can even instantiate controls and add it to your Node's controls collection.

    Sincerely yours,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top