Edit this page

Window HtmlHelper Overview

The Window HtmlHelper extension is a server-side wrapper for the Kendo UI Window widget.

It enables you to configure the Window from server-side code. The Window displays content in a modal or non-modal HTML window. By default, the user can move, resize, and close a Window. Its content can also be defined either as static HTML or dynamically loaded through AJAX.

For more information on the HtmlHelper, refer to the article on the Window HtmlHelper for ASP.NET MVC.

Basic Usage

The following example demonstrates how to define the Window by using the Window HtmlHelper.

Example
 @(Html.Kendo().Window()
    .Name("window")
    .Title("Window title")
    .Content(@<text>
            Static content of the Window.
    </text>)
)
    public class WindowController  : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    }

Configuration

The following example demonstrates the basic configuration of the Window HtmlHelper and how to get the Window instance.

Example
@(Html.Kendo().Window()
        .Name("window")
        .Width(630)
        .Height(300)
        .Title("Window title")
        .Actions(actions => actions.Refresh().Minimize().Maximize().Close())
        .LoadContentFrom("ajaxcontent1", "window")
        .Draggable()
        .Resizable()
        .Events(events => events
            .Open("onOpen")
            .Activate("onActivate")
            .Close("onClose")
            .Refresh("onRefresh")
            .Resize("onResize")
            .DragStart("onDragStart")
            .DragEnd("onDragEnd")
            .Deactivate("onDeactivate")
            .Minimize("onMinimize")
            .Maximize("onMaximize")
        )
)

<script type="text/javascript">
    $(function() {
        //Notice that the Name() of the Window is used to get its client-side instance.
        var dialog = $("#window").data("kendoWindow");
    });
</script>

See Also