errors after connecting kendo

2 Answers 11 Views
Accessibility
Вадим
Top achievements
Rank 1
Iron
Вадим asked on 17 Oct 2021, 08:46 AM

I used to work in ASP MVC, now I switched to ASP.NET Core, I connected all libraries and all elements.But 2 errors appear on startup: 

1) Could not load content for https://localhost:44395/lib/kendo/js/kendo.all.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Could not load content for https://localhost:44395/lib/kendo/js/kendo.aspnetmvc.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

2) kendo is not defined


<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - service</title>
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="~/css/site.css" />

    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2021.3.914/styles/kendo.bootstrap-v4.min.css" />

</head>

<body>
...................
<footer class="border-top footer text-muted">
        <div class="container">
            &copy; 2021 - service - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
        </div>
    </footer>
    @*<script src="~/lib/jquery/dist/jquery.min.js"></script>*@
    <script src="~/lib/kendo/js/jquery.min.js"></script>
    <script src="~/lib/kendo/js/kendo.all.min.js"></script>
    <script src="~/lib/kendo/js/kendo.aspnetmvc.min.js"></script>
    <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <script src="~/js/site.js" asp-append-version="true"></script>
    <script src="~/js/href.js" asp-append-version="true"></script>

    @RenderSection("Scripts", required: false)
</body>

Startup.cs:

public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext<Context_new>(options =>
                options.UseSqlServer(
                    Configuration.GetConnectionString("DefaultConnection")));
            services.AddIdentity<LoginViewModel, IdentityRole>().AddEntityFrameworkStores<Context_new>();
            services.AddRazorPages();
            services.AddKendo();

            services.Configure<CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            services
                .AddMvc(options => options.EnableEndpointRouting = false).SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
                .AddNewtonsoftJson(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());
        }

control.cshtml:


@using MvcModels.Contains
@using Kendo.Mvc.UI

<div class="container text-center">
    <div class="row">
        <h5>Панель администратора</h5>
    </div>
</div>

<div class="container">
    <div class="row">
        <div class="col-md-3">
            @(Html.Kendo().PanelBar()
                            .Name("MenuAdmin")
                            .ExpandMode(PanelBarExpandMode.Single)
                            .Items(panelBar =>
                            {
                                panelBar.Add()
                                .Text(MainPage.Users);
                                panelBar.Add()
                                .Text(MainPage.Category);
                                panelBar.Add()
                                .Text(MainPage.Parameters).Enabled(true);
                            })
            .Events(events => events.Select("menuSelectAdmin"))
            //.SecurityTrimming(true)
            )
        </div>

2 Answers, 1 is accepted

Sort by
0
Вадим
Top achievements
Rank 1
Iron
answered on 17 Oct 2021, 09:16 AM
the second question was solved thus:
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - service</title>

    <environment include="Development">
        <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
        <script src="~/lib/jquery/dist/jquery.js"></script>
        <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
        <link rel="stylesheet" href="~/lib/kendo/css/web/kendo.bootstrap-v4.min.css" />
        <script src="~/lib/kendo/js/kendo.all.min.js"></script>
        <script src="~/lib/kendo/js/kendo.aspnetmvc.min.js"></script>
    </environment>
    <environment exclude="Development">
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
              asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
              asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
              crossorigin="anonymous"
              integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" />
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
                asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
                asp-fallback-test="window.jQuery"
                crossorigin="anonymous"
                integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
        </script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"
                asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
                asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
                crossorigin="anonymous"
                integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o">
        </script>
        <link rel="stylesheet" href="~/lib/kendo/css/web/kendo.bootstrap-v4.min.css" />
        <script src="~/lib/kendo/js/kendo.all.min.js"></script>
        <script src="~/lib/kendo/js/kendo.aspnetmvc.min.js"></script>
    </environment>
    <script src="~/js/site.js" asp-append-version="true"></script>
    <script src="~/js/href.js" asp-append-version="true"></script>
    <link rel="stylesheet" href="~/css/site.css" />

</head>

0
Tsvetomir
Telerik team
answered on 20 Oct 2021, 11:48 AM

Hi, Vadim,

The warnings for the missing source map files probably come from the fact that the .map files are not included in the project - kendo.all.min.js.map and kendo.aspnetmvc.min.js.map.

If you want to remove these two messages, you can download the telerik.ui.for.aspnet.core.2021.3.914.commercial.zip archive from your profile on Telerik.com. In the JS folder inside the archive, you will find the missing files. Copy them to the wwwroot/lib/kendo/js folder in your project and the warning should disappear.

 

Regards,
Tsvetomir
Progress Telerik

Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.
Tags
Accessibility
Asked by
Вадим
Top achievements
Rank 1
Iron
Answers by
Вадим
Top achievements
Rank 1
Iron
Tsvetomir
Telerik team
Share this question
or