After I ran through the upgrader within Visual Studio 2019 to reference 2021.1.119 components I am all of a sudden seeing spurious <script> blocks rendered as inline html on certain (but not all) components and not on all views where various Kendo MVC components are referenced:
kendo.syncReady(function(){jQuery("#FiscalYearDropDown").kendoDropDownList({"change":onFiscalYearChange,"dataSource":{"transport":{"read":{"url":"/AssignedInvoices/GetFiscalYears"},"prefix":""},"schema":{"errors":"Errors"}},"dataTextField":"FiscalYear","dataValueField":"Fis
5 Answers, 1 is accepted
Hi,
I've tried to replicate the issue you are experiencing <script> blocks rendered as inline html on Telerik MVC components but no avail.
Could you please send us a simplified sample fully runnable project containing the minimum setup required so the issue could be observed and specify the reproduction steps so we could be able to replicate and debug it on our side, investigate it and do our best to provide you with reliable solution?
Best Regards,
Misho
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
I probably should have annotated that is only appears to happen with controls embedded in a KendoGrid Toolbar Template - as an example:
.ToolBar(t => {
t.Template(@<text>
<span class="card-text mr-1">Fiscal Year:</span>
@(Html.Kendo().DropDownList()
.Name("FiscalYearDropDown")
.DataTextField("FiscalYear")
.DataValueField("FiscalYear")
.HtmlAttributes(new { style = "width: 200px" })
.DataSource(source =>
{
source.Read(read =>
{
read.Action(MVC.AssignedInvoices.ActionNames.GetFiscalYears, MVC.AssignedInvoices.Name);
})
.ServerFiltering(false);
})
.Events(e => e.Change("onFiscalYearChange"))
.Value((string)ViewBag.CurrentFiscalYear)
)
</text>);
})
Hello,
Since the late Kendo UI R1 2021 release, the Grid Toolbar uses new styles to be aligned with Kendo UI Toolbar which affects the described behavior.
In the such case, the Kendo UI components needs to be wrapped in an element with class .toolbar:
This has been demonstrated in the following demo:
https://demos.telerik.com/aspnet-mvc/grid/toolbar-template
Best Regards,
Misho
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Misho,
That does indeed resolve the issue - much appreciated.
Regards,
Michael Jensen
Hi,
I'm glad that you managed to resolve the issue.
Please don't hesitate to contact us again if a specific issue pops up or in case you have other feedback or questions related to Telerik components.
Best Regards,
Misho
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.