htmlkendo-uikendo-gridkendo-template

Kendo UI Template notation for encoding doesn't seem to work


According to the Kendo UI template documentation, you can use either the #=Field# or #:Field# notation, with the #:Field# notation encoding the text. However, I cannot seem to get this to work.

I created a field in my model that just returned a string, <b>Todd</b>. Then, I used the template like this:

<a href="/page.aspx?path=#=Field#"></a>

and also like this:

<a href="/page.aspx?path=#:Field#"></a>

In BOTH cases, the output was

<a href="/page.aspx?path=<b>Todd<b>"></a>

While I would expect that for the #=Field# notation, for the #:Field# notation, I was expecting:

<a href="/page.aspx?path=%3Cb%3ETodd%3C/b%3E"></a>

Any ideas on why this isn't working like I am expecting?


Solution

  • Got a response from Kendo. They said do use #:encodeURI(Field)#, #:encodeURIComponent(Field)#, or #:escape(Field)# instead of #:Field# to get the result I was looking for.

    I tested that out, and it did work for me.