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

[Solved] ClientTemplate with special characters.

0 Answers 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Juan Pablo Perez
Top achievements
Rank 1
Juan Pablo Perez asked on 25 Mar 2011, 09:20 AM
Hello,

I'm using a ClientTemplate in a grid like in the example here. It works perfectly except when the fields included in the template has special characters like ' or ". Imagine in this example if LastName field contained the ' character (like in O'Grady), in this case eveything is redered incorrectly. Is there any way to avoid this, like using $.telerik.formatString?

Can anybody help me with this problem?

Thank you very much in advance.

Juan Pablo Pérez


"<div class='employee-details'>" +
          "<img src='" + Url.Content("~/Content/Grid/Employees/") +
              "<#= EmployeeID#>.jpg' alt='<#= FirstName #> <#= LastName #>' />" +
          "<ul>" +
              "<li><label>Birth Date:</label><#= $.telerik.formatString('{0:d}', BirthDate)
                  #></li>" +
              "<li><label>Country:</label><#= Country #></li>" +
              "<li><label>City:</label><#= City #></li>" +
              "<li><label>Address:</label><#= Address #></li>" +
              "<li><label>Home Phone:</label><#= HomePhone #></li>" +
          "</ul>" +
      "</div>"

Here is my ClientTemplate, and I have problems when Description field contains special characters:
"<fieldset>"
     + "<input type='button' class='but_detail' value='DataSheet' Title='DataSheet' onclick='OpenWindow(\"<#= Id#>\",\"<#= Code#>\",\"<#= Description#>\",\"" + @Url.Action("DataSheetPrint") + "\",\"DataSheet\")' />")
     + "<input type='button' class='but_detail' value='Movements' Title='Movements' onclick='OpenWindow(\"<#= Id#>\",\"<#= Code#>\",\"<#= Description#>\",\"" + @Url.Action("MovementsGridPrint") + "\",\"Movements\")' />")
 + "</fieldset>"

Tags
General Discussions
Asked by
Juan Pablo Perez
Top achievements
Rank 1
Share this question
or