I am getting the following errors when I run the following example :https://demos.telerik.com/aspnet-core/window
In the index page I am trying to reference this kendo.window.min.js, here is my code for the view:
@page "/"
@model StaffPortalCore.Views.Home.CropperModel
@{
}
@* Make sure tag helpers are not available for the Window content *@
@removeTagHelper "*, Microsoft.AspNet.Mvc.Razor"
@removeTagHelper "*, Microsoft.AspNetCore.Mvc.Razor"
@using Kendo.Mvc.UI;
@using (Html.BeginForm("Index", "Cropper", FormMethod.Post))
{<head>
<script type="text/javascript" src="@Url.Content("~/js/kendo.window.min.js")"></script>
</head>
<div class="configurator">
<div class="header">Configurator</div>
<div class="box-col">
<h4>Animation Settings</h4>
<ul class="options">
<li>
@Html.RadioButton("animation", "zoom")
@Html.Label("zoom", "default/zoom animation")
</li>
<li>
@Html.RadioButton("animation", "toggle")
@Html.Label("toggle", "toggle animation")
</li>
<li>
@Html.RadioButton("animation", "expand")
@Html.Label("expand", "expand animation")
</li>
<li>
@Html.CheckBox("opacity")
@Html.Label("opacity", "animate opacity")
</li>
</ul>
</div>
<div class="box-col">
<h4>Window Settings</h4>
<ul class="options">
<li>
@Html.CheckBox("draggable")
@Html.Label("draggable", "draggable")
</li>
<li>
@Html.CheckBox("resizable")
@Html.Label("resizable", "resizable")
</li>
</ul>
</div>
</div>
<button >Apply</button>
}
@(Html.Kendo().Window()
.Name("window")
.Animation(animation =>
{
animation.Open(open =>
{
if (ViewBag.animation == "expand")
{
open.Expand(ExpandDirection.Vertical);
}
if (ViewBag.animation == "zoom")
{
open.Zoom(ZoomDirection.In);
}
if (ViewBag.opacity)
{
open.Fade(FadeDirection.In);
}
});
animation.Close(close =>
{
close.Reverse(true);
if (ViewBag.animation == "expand")
{
close.Expand(ExpandDirection.Vertical);
}
if (ViewBag.animation == "zoom")
{
close.Zoom(ZoomDirection.Out);
close.Reverse(false);
}
if (ViewBag.opacity)
{
close.Fade(FadeDirection.In);
}
});
})
.Content(@<text>
<div style="text-align: center;">
<p>ARNE JACOBSEN EGG CHAIR<br /> Image by: <a href="https://www.conranshop.co.uk/" title="https://www.conranshop.co.uk/">https://www.conranshop.co.uk/</a></p>
</div>
</text>)
.Width(500)
.Draggable((bool)ViewBag.draggable)
.Resizable(resize => resize.Enabled((bool)ViewBag.resizable))
.Title("EGG CHAIR")
.Actions(actions => actions
.Custom("custom")
.Minimize()
.Maximize()
.Close()
)
.Events(events=> events.Close("close"))
)
<div class="responsive-message"></div>
<script type="text/javascript">
function close() {
$("#undo").fadeIn(300);
}
$(document).ready( function () {
var dialog = $("#window");
$("#undo")
.bind("click", function () {
$("#window").data("kendoWindow").open();
$("#undo").fadeOut(300);
});
dialog.data("kendoWindow").wrapper
.find(".k-i-custom").parent().click(function (e) {
alert("Custom action button clicked");
e.preventDefault();
});
});
</script>
<style>
#example {
min-height: 400px;
}
#undo {
text-align: center;
position: absolute;
white-space: nowrap;
padding: 1em;
cursor: pointer;
}
.k-window {
z-index: 100000;
}
@@media screen and (max-width: 1023px) {
div.k-window {
display: none !important;
}
}
</style>
An here is code for the controller:
using Microsoft.AspNetCore.Mvc; namespace StaffPortalCore.Controllers { public class CropperController : Controller { public ActionResult Index(string animation, bool? opacity, bool? draggable, bool? resizable) { ViewBag.animation = animation ?? "expand"; ViewBag.opacity = opacity ?? true; ViewBag.draggable = draggable ?? true; ViewBag.resizable = resizable ?? true; return View(); } } }
Can someone please advise which scripts I need to reference and how I should reference them. Thank in advance