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

[Solved] Hyperlink Encoding in a Grid Column

2 Answers 212 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Forest
Top achievements
Rank 1
Forest asked on 21 Jun 2011, 03:53 PM
Please consider the following snippet:
columns.Bound(o=> o.ActionsUrl)
       .ClientTemplate("<#= ActionsUrl #>" )
       .Title("Actions");

The ActionsUrl property is either an empty string or an a hyperlink to an appropriate url depending on some data in the model being rendered.

In the client template, this property renders properly as a hyperlink.

However, on the server side when the grid originally loads up, the hyperlinks are html encoded as coming across as a raw string.  For example, if I look at the rendered HTML, the link renders like this:

&lt;a href=http://server-name/Visitor/Edit/3&gt;Select&lt;/a&gt;

The client template will render the < and > tags.  The first time, however, is HTML encoding them.  I'm not sure if this is a Telerik thing or an MVC thing.
 
Is there a work around? 

Thank you.

2 Answers, 1 is accepted

Sort by
0
Accepted
Demon
Top achievements
Rank 1
answered on 21 Jun 2011, 04:01 PM
Hi, set Encoded(false) to the column.
0
Forest
Top achievements
Rank 1
answered on 21 Jun 2011, 04:07 PM
Nice :)
Tags
Grid
Asked by
Forest
Top achievements
Rank 1
Answers by
Demon
Top achievements
Rank 1
Forest
Top achievements
Rank 1
Share this question
or