Search code examples
asp.net-mvckendo-uikendo-asp.net-mvc

how to set LoadContentFrom kendo window in run time


i'm starter in kendo ui, i want use kendoUi window but i have some problem for use i write this code for create window

@(Html.Kendo().Window().Name("Details")
    .Title("Customer Details")
    .Visible(false)
    .Modal(true)
    .Draggable(true)
    .Width(300)       
)

in page i have some button , i want when user click in one of this button set LoadContentFrom dynamically with jquery. But I do not know how to do it. please help me. thanks all.


Solution

  • you can try this:

       $("#yourbuttonID").bind("click", function() {
           $("#Details").data("kendoWindow").open();
       });
    

    to load content to use:

    @(Html.Kendo().Window().Name("Details")
        .Title("Customer Details")
        .Visible(false)
        .Modal(true)
        .Draggable(true)
        .LoadContentFrom("brand", "edit") 
        .Width(300)
    )