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">
© 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>