Hello Sunitha,
You need to add the scripts to the wwwroot folder and set the path to point to them, for example:
<environment include="Development">
...
<script src="~/lib/jquery/dist/jquery.js"></script>
@* Place the Kendo UI scripts after jQuery. *@
<script src="~/lib/kendo-ui/js/kendo.all.min.js"></script>
<script src="~/lib/kendo-ui/js/kendo.aspnetmvc.min.js"></script>
</environment>
For adding the Client-side resources for Telerik UI for ASP.NET Core refer to the respective documentation section here. If general guidance on static resources is required I suggest the official MSDN documentation.
Regards,
Aleksandar
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hi Aleksander,
I am also facing same script error while using VS2022 ASP.NET Core MVC app. How can i set the paths in _layout.cshtml in asp.net core mvc app?
Thanks
Hi Laura,
An alternative CDN that can be used is cdn.kendostatic.com:
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>@ViewBag.Title - My Telerik MVC Application</title>
<link rel="stylesheet" href="https://cdn.kendostatic.com/2021.2.616/styles/kendo.default-v2.min.css">
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://cdn.kendostatic.com/2021.2.616/js/kendo.all.min.js"></script>
<script src="https://cdn.kendostatic.com/2021.2.616/js/kendo.aspnetmvc.min.js"></script>
</head>
Regards,
Aleksandar
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/.
Hi Laura,
Thank you for reporting this issue. The errors are logged as the CDN service has the same domain name as the www.telerik.com site, thus when using it to load scripts and styles any cookies stored associated with the www.telerik.com site will be flagged as non-compliant an the errors you see are logged.
To resolve the errors logged by Chrome, until the issue is fixed, you can serve the scripts from the application instead of relying on the CDN service:
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>@ViewBag.Title - My Telerik MVC Application</title>
<link href="~/Content/kendo.default-v2.min.css" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="~/Scripts/jquery.min.js"></script>
<script src="~/Scripts/kendo.all.min.js"></script>
<script src="~/Scripts/kendo.aspnetmvc.min.js"></script>
<script src="@Url.Content("~/Scripts/bootstrap.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>
</head>
Regards,
Aleksandar
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/.