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

Problem with node text

2 Answers 66 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Balaji
Top achievements
Rank 1
Balaji asked on 03 Aug 2009, 09:40 AM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Aug 2009, 11:30 AM
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
0
Balaji
Top achievements
Rank 1
answered on 03 Aug 2009, 11:59 AM
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
Tags
TreeView
Asked by
Balaji
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Balaji
Top achievements
Rank 1
Share this question
or