Loading Content

The content of the Window HTML helper could be hardcoded or loaded dynamically at a later stage.

Displaying Static Content

The Window exposes a Content() configuration method, which allows a predefined HTML content to be loaded:

Example
@(Html.Kendo().Window()
    .Name("window")
    .Title("Static content")
    .Content(@<text>
            <strong>Static content</strong> of the Window.
    </text>)
)

Load-on-Demand Content

To configure the Window with a load-on-demand content, follow the steps listed below.

  1. Create a new action method, which renders the view.

    Example
    public IActionResult Index()
    {
        return View();
    }
    
  2. Create an action method which renders the content.

    Example
    public IActionResult AjaxContent()
    {
        return View();
    }
    
  3. Add a Window.

    Example
    @(Html.Kendo().Window()
        .Name("window") //The name of the Window is mandatory. It specifies the "id" attribute of the widget.
        .Title("About Alvar Aalto") //Set the title of the Window.
        .LoadContentFrom("AjaxContent", "Window") //Define the Action and Controller names.
    )
    

See Also

In this article
Not finding the help you need? Improve this article