ClientTemplate causing issue with strict CSP

1 Answer 74 Views
Grid
Laxmi
Top achievements
Rank 1
Laxmi asked on 30 May 2023, 02:27 PM

Hi,

I am working on making application CSP complaint using  UI for ASP.NET MVC R1 2023 SP2 (version 2023.1.425).

Grid column is having ClientTemplate which is causing grid to be empty. This was working prior.

Below is the code snippet:

.ClientTemplate("<a target='_blank' href=" + @Url.Action("ReportRouter", "Reports") + "?reportId=#=ReportId#>#=DisplayName#</a>");

 

Developer tool is showing Invalid template error. I have also added 

@(Html.Kendo().DeferredScriptFile())

 

Any input is appreciated.

 


1 Answer, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 02 Jun 2023, 11:15 AM

Hello Laxmi,

Thank you for the code snippet and details provided.

In order to achieve the desired result, I would recommend using a function handler.

From the function handler, use an Ajax Request to the "ReportRouter" Action Method and return the needed content.

Give a try to the approach above and let me know if is achieves the desired result.

Kind Regards,
Anton Mironov
Progress Telerik

As of R2 2023, the default icon type will be SVG instead of Font. See this blogpost for more information.

Tags
Grid
Asked by
Laxmi
Top achievements
Rank 1
Answers by
Anton Mironov
Telerik team
Share this question
or