Problem with node text

3 posts, 0 answers
  1. Balaji
    Balaji avatar
    30 posts
    Member since:
    Mar 2008

    Posted 03 Aug 2009 Link to this post

    Hi Telerik,

    I am using ajax rad  tree view in our project. And there is a chance that user can put some html tags as node text.

    For example if we use node text as <marquee>test</marquee>, the text is moving horizantally.
    but it should render like "<marquee>test</marquee>"

    Please suggest me to stop rendering the text as html.

    Thanks in advance,
    Balaji Velasiri.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Aug 2009 Link to this post

    Hi Balaji,

    One suggestion will be to use a Literal control where you can set the Mode property to Encode which will show the html text as such. You may place the Literal control inside the NodeTemplate of RadTreeView. Just give a try with the following approach and see whether it helps.

    ASPX:
     
    <telerik:RadTreeView ID="RadTreeView1" runat="server"
                     <Nodes> 
                       <telerik:RadTreeNode Text="Node1" ></telerik:RadTreeNode> 
                        <telerik:RadTreeNode> 
                         <NodeTemplate> 
                          <asp:Literal ID="Literal1" runat="server" Mode="Encode" Text="<marquee>test</marquee>" ></asp:Literal> 
                         </NodeTemplate> 
                       </telerik:RadTreeNode> 
                     </Nodes> 
                    </telerik:RadTreeView> 


    Best Regards
    Shinu
  3. Balaji
    Balaji avatar
    30 posts
    Member since:
    Mar 2008

    Posted 03 Aug 2009 Link to this post

    Hi Shinu,

    We are creating treeview nodes from the javascript. So I can not use NodeTemplate.

    Please suggest me in this regard.

    Thanks in advance,
    Balaji Velasiri
Back to Top